Beispiel #1
0
    def testParseValueData(self):
        """Tests the _ParseValueData function."""
        plugin = (windows.WindowsProgramFilesEnvironmentVariablePlugin())
        knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(
            plugin)

        environment_variable = knowledge_base.GetEnvironmentVariable(
            u'ProgramFiles')
        self.assertIsNotNone(environment_variable)
        self.assertEqual(environment_variable.value, u'C:\\Program Files')
Beispiel #2
0
    def testParseValueData(self):
        """Tests the _ParseValueData function."""
        test_file_path = self._GetTestFilePath(['SOFTWARE'])
        self._SkipIfPathNotExists(test_file_path)

        plugin = (windows.WindowsProgramFilesEnvironmentVariablePlugin())
        knowledge_base_object = (
            self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(plugin))

        environment_variable = knowledge_base_object.GetEnvironmentVariable(
            'ProgramFiles')
        self.assertIsNotNone(environment_variable)
        self.assertEqual(environment_variable.value, 'C:\\Program Files')
Beispiel #3
0
    def testParseValueData(self):
        """Tests the _ParseValueData function."""
        test_file_path = self._GetTestFilePath(['SOFTWARE'])
        self._SkipIfPathNotExists(test_file_path)

        storage_writer = self._CreateTestStorageWriter()

        plugin = windows.WindowsProgramFilesEnvironmentVariablePlugin()
        test_mediator = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(
            storage_writer, plugin)

        self.assertEqual(storage_writer.number_of_preprocessing_warnings, 0)

        environment_variable = test_mediator.knowledge_base.GetEnvironmentVariable(
            'ProgramFiles')
        self.assertIsNotNone(environment_variable)
        self.assertEqual(environment_variable.value, 'C:\\Program Files')