# Path: dtformats/rp_log.py
# class RestorePointLogFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('rp_log.yaml')
#   _EVENT_TYPES = {
#       0x00000064: 'BEGIN_SYSTEM_CHANGE',
#       0x00000065: 'END_SYSTEM_CHANGE',
#       0x00000066: 'BEGIN_NESTED_SYSTEM_CHANGE',
#       0x00000067: 'END_NESTED_SYSTEM_CHANGE',
#   }
#   _RESTORE_POINT_TYPES = {
#       0x00000000: 'APPLICATION_INSTALL',
#       0x00000001: 'APPLICATION_UNINSTALL',
#       0x0000000a: 'DEVICE_DRIVER_INSTALL',
#       0x0000000c: 'MODIFY_SETTINGS',
#       0x0000000d: 'CANCELLED_OPERATION',
#   }
#   def __init__(self, debug=False, output_writer=None):
#   def _DebugPrintFileFooter(self, file_footer):
#   def _DebugPrintFileHeader(self, file_header):
#   def _ReadFileFooter(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 rp_log
from tests import test_lib
  def testDebugPrintFileFooter(self):
    """Tests the _DebugPrintFileFooter function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = rp_log.RestorePointLogFile(output_writer=output_writer)

    data_type_map = test_file._GetDataTypeMap('rp_log_file_footer')

    file_footer = data_type_map.CreateStructureValues(
        creation_time=1)

    test_file._DebugPrintFileFooter(file_footer)

  def testDebugPrintFileHeader(self):
    """Tests the _DebugPrintFileHeader function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = rp_log.RestorePointLogFile(output_writer=output_writer)

    data_type_map = test_file._GetDataTypeMap('rp_log_file_header')

    file_header = data_type_map.CreateStructureValues(
        description='Description'.encode('utf-16-le'),
        event_type=1,
        restore_point_type=2,
        sequence_number=3)

    test_file._DebugPrintFileHeader(file_header)

  def testReadFileFooter(self):
    """Tests the _ReadFileFooter function."""
    output_writer = test_lib.TestOutputWriter()

# Path: dtformats/rp_log.py
# class RestorePointLogFile(data_format.BinaryDataFile):
#   _FABRIC = data_format.BinaryDataFile.ReadDefinitionFile('rp_log.yaml')
#   _EVENT_TYPES = {
#       0x00000064: 'BEGIN_SYSTEM_CHANGE',
#       0x00000065: 'END_SYSTEM_CHANGE',
#       0x00000066: 'BEGIN_NESTED_SYSTEM_CHANGE',
#       0x00000067: 'END_NESTED_SYSTEM_CHANGE',
#   }
#   _RESTORE_POINT_TYPES = {
#       0x00000000: 'APPLICATION_INSTALL',
#       0x00000001: 'APPLICATION_UNINSTALL',
#       0x0000000a: 'DEVICE_DRIVER_INSTALL',
#       0x0000000c: 'MODIFY_SETTINGS',
#       0x0000000d: 'CANCELLED_OPERATION',
#   }
#   def __init__(self, debug=False, output_writer=None):
#   def _DebugPrintFileFooter(self, file_footer):
#   def _DebugPrintFileHeader(self, file_header):
#   def _ReadFileFooter(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/rp_log.py
import unittest
from dtformats import rp_log
from tests import test_lib

  def testDebugPrintFileFooter(self):
    """Tests the _DebugPrintFileFooter function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = rp_log.RestorePointLogFile(output_writer=output_writer)

    data_type_map = test_file._GetDataTypeMap('rp_log_file_footer')

    file_footer = data_type_map.CreateStructureValues(
        creation_time=1)

    test_file._DebugPrintFileFooter(file_footer)

  def testDebugPrintFileHeader(self):
    """Tests the _DebugPrintFileHeader function."""
    output_writer = test_lib.TestOutputWriter()
    test_file = rp_log.RestorePointLogFile(output_writer=output_writer)

    data_type_map = test_file._GetDataTypeMap('rp_log_file_header')

    file_header = data_type_map.CreateStructureValues(
        description='Description'.encode('utf-16-le'),
        event_type=1,
        restore_point_type=2,
        sequence_number=3)

    test_file._DebugPrintFileHeader(file_header)

  def testReadFileFooter(self):
    """Tests the _ReadFileFooter function."""
    output_writer = test_lib.TestOutputWriter()

    test_file = rp_log.RestorePointLogFile(output_writer=output_writer)