# Path: dtformats/recycle_bin.py
# class RecycleBinMetadataFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('recycle_bin.yaml')
#   _SUPPORTED_FORMAT_VERSION = (1, 2)
#   _DEBUG_INFO_FILE_HEADER = [
#       ('format_version', 'Format version', '_FormatIntegerAsDecimal'),
#       ('original_file_size', 'Original file size', '_FormatIntegerAsDecimal'),
#       ('deletion_time', 'Deletion time', '_FormatIntegerAsFiletime')]
#   def __init__(self, debug=False, output_writer=None):
#   def _ReadFileHeader(self, file_object):
#   def _ReadOriginalFilename(self, file_object, format_version):
#   def ReadFileObject(self, file_object):
# 
# Path: tests/test_lib.py
# class BaseTestCase(unittest.TestCase):
# class TestOutputWriter(output_writers.OutputWriter):
#   _TEST_DATA_PATH = os.path.join(os.getcwd(), 'test_data')
#   def _GetTestFilePath(self, path_segments):
#   def _SkipIfPathNotExists(self, path):
#   def __init__(self):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):


import unittest
from dtformats import recycle_bin
from tests import test_lib
    test_file_path = self._GetTestFilePath(['$II3DF3L.zip'])
    self._SkipIfPathNotExists(test_file_path)

    with open(test_file_path, 'rb') as file_object:
      file_header = test_file._ReadFileHeader(file_object)

    self.assertEqual(file_header.format_version, 1)
    self.assertEqual(file_header.original_file_size, 724919)
    self.assertEqual(file_header.deletion_time, 129760589986330000)

  def testReadOriginalFilename(self):
    """Tests the _ReadOriginalFilename function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = recycle_bin.RecycleBinMetadataFile(output_writer=output_writer)

    test_file_path = self._GetTestFilePath(['$II3DF3L.zip'])
    self._SkipIfPathNotExists(test_file_path)

    with open(test_file_path, 'rb') as file_object:
      file_header = test_file._ReadFileHeader(file_object)
      original_filename = test_file._ReadOriginalFilename(
          file_object, file_header.format_version)

    expected_original_filename = (
        'C:\\Users\\bogus\\Documents\\RandomResearch\\Archives.zip')
    self.assertEqual(original_filename, expected_original_filename)

  def testReadFileObjectFormatVersion1(self):
    """Tests the ReadFileObject function on a format version 1 file."""
    output_writer = test_lib.TestOutputWriter()

# Path: dtformats/recycle_bin.py
# class RecycleBinMetadataFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('recycle_bin.yaml')
#   _SUPPORTED_FORMAT_VERSION = (1, 2)
#   _DEBUG_INFO_FILE_HEADER = [
#       ('format_version', 'Format version', '_FormatIntegerAsDecimal'),
#       ('original_file_size', 'Original file size', '_FormatIntegerAsDecimal'),
#       ('deletion_time', 'Deletion time', '_FormatIntegerAsFiletime')]
#   def __init__(self, debug=False, output_writer=None):
#   def _ReadFileHeader(self, file_object):
#   def _ReadOriginalFilename(self, file_object, format_version):
#   def ReadFileObject(self, file_object):
# 
# Path: tests/test_lib.py
# class BaseTestCase(unittest.TestCase):
# class TestOutputWriter(output_writers.OutputWriter):
#   _TEST_DATA_PATH = os.path.join(os.getcwd(), 'test_data')
#   def _GetTestFilePath(self, path_segments):
#   def _SkipIfPathNotExists(self, path):
#   def __init__(self):
#   def Close(self):
#   def Open(self):
#   def WriteText(self, text):


# Path: tests/recycle_bin.py
import unittest
from dtformats import recycle_bin
from tests import test_lib

    test_file_path = self._GetTestFilePath(['$II3DF3L.zip'])
    self._SkipIfPathNotExists(test_file_path)

    with open(test_file_path, 'rb') as file_object:
      file_header = test_file._ReadFileHeader(file_object)

    self.assertEqual(file_header.format_version, 1)
    self.assertEqual(file_header.original_file_size, 724919)
    self.assertEqual(file_header.deletion_time, 129760589986330000)

  def testReadOriginalFilename(self):
    """Tests the _ReadOriginalFilename function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = recycle_bin.RecycleBinMetadataFile(output_writer=output_writer)

    test_file_path = self._GetTestFilePath(['$II3DF3L.zip'])
    self._SkipIfPathNotExists(test_file_path)

    with open(test_file_path, 'rb') as file_object:
      file_header = test_file._ReadFileHeader(file_object)
      original_filename = test_file._ReadOriginalFilename(
          file_object, file_header.format_version)

    expected_original_filename = (
        'C:\\Users\\bogus\\Documents\\RandomResearch\\Archives.zip')
    self.assertEqual(original_filename, expected_original_filename)

  def testReadFileObjectFormatVersion1(self):
    """Tests the ReadFileObject function on a format version 1 file."""
    output_writer = test_lib.TestOutputWriter()

    test_file = recycle_bin.RecycleBinMetadataFile(