Exemplo n.º 1
0
    def testParseValueData(self):
        """Tests the _ParseValueData function."""
        plugin = windows.WindowsHostnamePlugin()
        knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSystem(
            plugin)

        self.assertEqual(knowledge_base.hostname, u'WKS-WIN732BITA')
Exemplo n.º 2
0
  def testParseValueData(self):
    """Tests the _ParseValueData function."""
    test_file_path = self._GetTestFilePath(['SYSTEM'])
    self._SkipIfPathNotExists(test_file_path)

    plugin = windows.WindowsHostnamePlugin()
    knowledge_base_object = (
        self._RunPreprocessorPluginOnWindowsRegistryValueSystem(plugin))

    self.assertEqual(knowledge_base_object.hostname, 'WKS-WIN732BITA')
Exemplo n.º 3
0
    def testParseValueData(self):
        """Tests the _ParseValueData function."""
        test_file_path = self._GetTestFilePath(['SYSTEM'])
        self._SkipIfPathNotExists(test_file_path)

        storage_writer = self._CreateTestStorageWriter()

        plugin = windows.WindowsHostnamePlugin()
        test_mediator = self._RunPreprocessorPluginOnWindowsRegistryValueSystem(
            storage_writer, plugin)

        self.assertEqual(storage_writer.number_of_preprocessing_warnings, 0)

        hostname = test_mediator.knowledge_base.GetHostname()
        self.assertEqual(hostname, 'WKS-WIN732BITA')

        value_data = ['MyHost', '']
        plugin._ParseValueData(test_mediator, value_data)