Example #1
0
 def setUp(self):
   """Sets up the needed objects used throughout the test."""
   self._output_writer = cli_test_lib.TestOutputWriter(encoding=u'utf-8')
   self._test_tool = preg.PregTool(output_writer=self._output_writer)
   self._test_console = preg.PregConsole(self._test_tool)
   file_entry = self._GetTestFileEntryFromPath([u'NTUSER.DAT'])
   self._file_path = self._GetTestFilePath([u'NTUSER.DAT'])
   self._registry_helper = preg_frontend.PregRegistryHelper(
       file_entry, u'OS', self._test_tool._knowledge_base_object)
Example #2
0
  def setUp(self):
    """Sets up the needed objects used throughout the test."""
    self._output_writer = cli_test_lib.TestOutputWriter(encoding=u'utf-8')
    test_tool = preg.PregTool(output_writer=self._output_writer)
    front_end = getattr(test_tool, '_front_end', None)
    front_end.SetKnowledgeBase(test_tool._knowledge_base_object)

    self._test_console = preg.PregConsole(test_tool)
    self._magic_obj = preg.PregMagics(None)
    self._magic_obj.console = self._test_console
    self._magic_obj.output_writer = self._output_writer

    registry_file_entry = self._GetTestFileEntryFromPath([u'NTUSER.DAT'])
    self._registry_helper = preg_frontend.PregRegistryHelper(
        registry_file_entry, u'OS', test_tool._knowledge_base_object)

    self._test_console.AddRegistryHelper(self._registry_helper)
    self._test_console.LoadRegistryFile(0)
    setattr(self._test_console, '_output_writer', self._output_writer)