# Path: dtformats/recycler.py
# class RecyclerInfo2File(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('recycler.yaml')
#   _DEBUG_INFO_FILE_ENTRY = [
#       ('original_filename', 'Original filename (ANSI)', '_FormatANSIString'),
#       ('index', 'Index', '_FormatIntegerAsDecimal'),
#       ('drive_number', 'Drive number', '_FormatIntegerAsDecimal'),
#       ('deletion_time', 'Deletion time', '_FormatIntegerAsFiletime'),
#       ('original_file_size', 'Original file size', '_FormatIntegerAsDecimal')]
#   _DEBUG_INFO_FILE_HEADER = [
#       ('unknown1', 'Unknown1', '_FormatIntegerAsHexadecimal8'),
#       ('number_of_file_entries', 'Number of file entries',
#        '_FormatIntegerAsDecimal'),
#       ('unknown2', 'Unknown2', '_FormatIntegerAsHexadecimal8'),
#       ('file_entry_size', 'File entry size', '_FormatIntegerAsDecimal'),
#       ('unknown3', 'Unknown3', '_FormatIntegerAsHexadecimal8')]
#   def __init__(self, debug=False, output_writer=None):
#   def _FormatANSIString(self, string):
#   def _ReadFileEntry(self, file_object):
#   def _ReadFileHeader(self, file_object):
#   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 recycler
from tests import test_lib
# -*- coding: utf-8 -*-
"""Tests for Windows Recycler INFO2 files."""





class RecyclerInfo2FileTest(test_lib.BaseTestCase):
  """Windows Recycler INFO2 file tests."""

  # pylint: disable=protected-access

  # TODO: add test for _FormatANSIString
  # TODO: add test for _ReadFileEntry

  def testReadFileHeader(self):
    """Tests the _ReadFileHeader function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = recycler.RecyclerInfo2File(output_writer=output_writer)

    test_file_path = self._GetTestFilePath(['INFO2'])
    self._SkipIfPathNotExists(test_file_path)

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

  def testReadFileObjectFormatVersion1(self):
    """Tests the ReadFileObject function."""
    output_writer = test_lib.TestOutputWriter()

# Path: dtformats/recycler.py
# class RecyclerInfo2File(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('recycler.yaml')
#   _DEBUG_INFO_FILE_ENTRY = [
#       ('original_filename', 'Original filename (ANSI)', '_FormatANSIString'),
#       ('index', 'Index', '_FormatIntegerAsDecimal'),
#       ('drive_number', 'Drive number', '_FormatIntegerAsDecimal'),
#       ('deletion_time', 'Deletion time', '_FormatIntegerAsFiletime'),
#       ('original_file_size', 'Original file size', '_FormatIntegerAsDecimal')]
#   _DEBUG_INFO_FILE_HEADER = [
#       ('unknown1', 'Unknown1', '_FormatIntegerAsHexadecimal8'),
#       ('number_of_file_entries', 'Number of file entries',
#        '_FormatIntegerAsDecimal'),
#       ('unknown2', 'Unknown2', '_FormatIntegerAsHexadecimal8'),
#       ('file_entry_size', 'File entry size', '_FormatIntegerAsDecimal'),
#       ('unknown3', 'Unknown3', '_FormatIntegerAsHexadecimal8')]
#   def __init__(self, debug=False, output_writer=None):
#   def _FormatANSIString(self, string):
#   def _ReadFileEntry(self, file_object):
#   def _ReadFileHeader(self, file_object):
#   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/recycler.py
import unittest
from dtformats import recycler
from tests import test_lib

# -*- coding: utf-8 -*-
"""Tests for Windows Recycler INFO2 files."""





class RecyclerInfo2FileTest(test_lib.BaseTestCase):
  """Windows Recycler INFO2 file tests."""

  # pylint: disable=protected-access

  # TODO: add test for _FormatANSIString
  # TODO: add test for _ReadFileEntry

  def testReadFileHeader(self):
    """Tests the _ReadFileHeader function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = recycler.RecyclerInfo2File(output_writer=output_writer)

    test_file_path = self._GetTestFilePath(['INFO2'])
    self._SkipIfPathNotExists(test_file_path)

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

  def testReadFileObjectFormatVersion1(self):
    """Tests the ReadFileObject function."""
    output_writer = test_lib.TestOutputWriter()

    test_file = recycler.RecyclerInfo2File(