Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1020)

Unified Diff: tests/preprocessors/windows.py

Issue 322490043: [plaso] Added Linux system product preprocessor plugin #1337 (Closed)
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« plaso/preprocessors/windows.py ('K') | « tests/preprocessors/linux.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/preprocessors/windows.py
diff --git a/tests/preprocessors/windows.py b/tests/preprocessors/windows.py
index 1fc80475c30e91ec618c3df38f13959c0b9b3154..553b73bbec639f6566b96420f9b48067942c61ef 100644
--- a/tests/preprocessors/windows.py
+++ b/tests/preprocessors/windows.py
@@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
"""Tests for the Windows preprocess plug-ins."""
+from __future__ import unicode_literals
+
import unittest
from dfvfs.helpers import fake_file_system_builder
@@ -17,34 +19,34 @@ from tests.preprocessors import test_lib
class WindowsCodepagePlugin(test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the Windows codepage plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SYSTEM'])
+ @shared_test_lib.skipUnlessHasTestFile(['SYSTEM'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = windows.WindowsCodepagePlugin()
knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSystem(
plugin)
- self.assertEqual(knowledge_base.codepage, u'cp1252')
+ self.assertEqual(knowledge_base.codepage, 'cp1252')
class WindowsHostnamePluginTest(test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the Windows hostname plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SYSTEM'])
+ @shared_test_lib.skipUnlessHasTestFile(['SYSTEM'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = windows.WindowsHostnamePlugin()
knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSystem(
plugin)
- self.assertEqual(knowledge_base.hostname, u'WKS-WIN732BITA')
+ self.assertEqual(knowledge_base.hostname, 'WKS-WIN732BITA')
class WindowsProgramFilesEnvironmentVariablePluginTest(
test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the %ProgramFiles% environment variable plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
+ @shared_test_lib.skipUnlessHasTestFile(['SOFTWARE'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = (
@@ -53,16 +55,16 @@ class WindowsProgramFilesEnvironmentVariablePluginTest(
plugin)
environment_variable = knowledge_base.GetEnvironmentVariable(
- u'ProgramFiles')
+ 'ProgramFiles')
self.assertIsNotNone(environment_variable)
- self.assertEqual(environment_variable.value, u'C:\\Program Files')
+ self.assertEqual(environment_variable.value, 'C:\\Program Files')
class WindowsProgramFilesX86EnvironmentVariablePluginTest(
test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the %ProgramFilesX86% environment variable plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
+ @shared_test_lib.skipUnlessHasTestFile(['SOFTWARE'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = (
@@ -71,7 +73,7 @@ class WindowsProgramFilesX86EnvironmentVariablePluginTest(
plugin)
environment_variable = knowledge_base.GetEnvironmentVariable(
- u'ProgramFilesX86')
+ 'ProgramFilesX86')
# The test SOFTWARE Registry file does not contain a value for
# the Program Files X86 path.
self.assertIsNone(environment_variable)
@@ -87,62 +89,62 @@ class WindowsSystemRootEnvironmentVariablePluginTest(
"""Tests the _ParsePathSpecification function."""
file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
file_system_builder.AddFile(
- u'/Windows/System32/config/SYSTEM', self._FILE_DATA)
+ '/Windows/System32/config/SYSTEM', self._FILE_DATA)
mount_point = path_spec_factory.Factory.NewPathSpec(
- dfvfs_definitions.TYPE_INDICATOR_FAKE, location=u'/')
+ dfvfs_definitions.TYPE_INDICATOR_FAKE, location='/')
plugin = (
windows.WindowsSystemRootEnvironmentVariablePlugin())
knowledge_base = self._RunPreprocessorPluginOnFileSystem(
file_system_builder.file_system, mount_point, plugin)
- environment_variable = knowledge_base.GetEnvironmentVariable(u'SystemRoot')
+ environment_variable = knowledge_base.GetEnvironmentVariable('SystemRoot')
self.assertIsNotNone(environment_variable)
- self.assertEqual(environment_variable.value, u'\\Windows')
+ self.assertEqual(environment_variable.value, '\\Windows')
class WindowsSystemProductPluginTest(
test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the system product information plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
+ @shared_test_lib.skipUnlessHasTestFile(['SOFTWARE'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = windows.WindowsSystemProductPlugin()
knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(
plugin)
- osversion = knowledge_base.GetValue(u'operating_system_product')
- self.assertEqual(osversion, u'Windows 7 Ultimate')
+ system_product = knowledge_base.GetValue('operating_system_product')
+ self.assertEqual(system_product, 'Windows 7 Ultimate')
class WindowsSystemVersionPluginTest(
test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the system version information plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
+ @shared_test_lib.skipUnlessHasTestFile(['SOFTWARE'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = windows.WindowsSystemVersionPlugin()
knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(
plugin)
- osversion = knowledge_base.GetValue(u'operating_system_version')
- self.assertEqual(osversion, u'6.1')
+ system_version = knowledge_base.GetValue('operating_system_version')
+ self.assertEqual(system_version, '6.1')
class WindowsTimeZonePluginTest(test_lib.ArtifactPreprocessorPluginTestCase):
"""Tests for the time zone plugin."""
- @shared_test_lib.skipUnlessHasTestFile([u'SYSTEM'])
+ @shared_test_lib.skipUnlessHasTestFile(['SYSTEM'])
def testParseValueData(self):
"""Tests the _ParseValueData function."""
plugin = windows.WindowsTimeZonePlugin()
knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSystem(
plugin)
- self.assertEqual(knowledge_base.timezone.zone, u'EST5EDT')
+ self.assertEqual(knowledge_base.timezone.zone, 'EST5EDT')
class WindowsUserAccountsPluginTest(
@@ -151,7 +153,7 @@ class WindowsUserAccountsPluginTest(
# pylint: disable=protected-access
- @shared_test_lib.skipUnlessHasTestFile([u'SOFTWARE'])
+ @shared_test_lib.skipUnlessHasTestFile(['SOFTWARE'])
def testParseKey(self):
"""Tests the _ParseKey function."""
plugin = windows.WindowsUserAccountsPlugin()
@@ -166,10 +168,10 @@ class WindowsUserAccountsPluginTest(
user_account = users[9]
- expected_sid = u'S-1-5-21-2036804247-3058324640-2116585241-1114'
+ expected_sid = 'S-1-5-21-2036804247-3058324640-2116585241-1114'
self.assertEqual(user_account.identifier, expected_sid)
- self.assertEqual(user_account.username, u'rsydow')
- self.assertEqual(user_account.user_directory, u'C:\\Users\\rsydow')
+ self.assertEqual(user_account.username, 'rsydow')
+ self.assertEqual(user_account.user_directory, 'C:\\Users\\rsydow')
class WindowsWinDirEnvironmentVariablePluginTest(
@@ -182,19 +184,19 @@ class WindowsWinDirEnvironmentVariablePluginTest(
"""Tests the _ParsePathSpecification function."""
file_system_builder = fake_file_system_builder.FakeFileSystemBuilder()
file_system_builder.AddFile(
- u'/Windows/System32/config/SYSTEM', self._FILE_DATA)
+ '/Windows/System32/config/SYSTEM', self._FILE_DATA)
mount_point = path_spec_factory.Factory.NewPathSpec(
- dfvfs_definitions.TYPE_INDICATOR_FAKE, location=u'/')
+ dfvfs_definitions.TYPE_INDICATOR_FAKE, location='/')
plugin = (
windows.WindowsWinDirEnvironmentVariablePlugin())
knowledge_base = self._RunPreprocessorPluginOnFileSystem(
file_system_builder.file_system, mount_point, plugin)
- environment_variable = knowledge_base.GetEnvironmentVariable(u'WinDir')
+ environment_variable = knowledge_base.GetEnvironmentVariable('WinDir')
self.assertIsNotNone(environment_variable)
- self.assertEqual(environment_variable.value, u'\\Windows')
+ self.assertEqual(environment_variable.value, '\\Windows')
if __name__ == '__main__':
« plaso/preprocessors/windows.py ('K') | « tests/preprocessors/linux.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b