def testParseKey(self): """Tests the _ParseKey function.""" test_file_path = self._GetTestFilePath(['SOFTWARE']) self._SkipIfPathNotExists(test_file_path) storage_writer = self._CreateTestStorageWriter() plugin = windows.WindowsUserAccountsPlugin() test_mediator = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware( storage_writer, plugin) self.assertEqual(storage_writer.number_of_preprocessing_warnings, 0) user_accounts = sorted( test_mediator.knowledge_base.user_accounts, key=lambda user_account: user_account.identifier) self.assertIsNotNone(user_accounts) self.assertEqual(len(user_accounts), 11) user_account = user_accounts[9] expected_sid = 'S-1-5-21-2036804247-3058324640-2116585241-1114' self.assertEqual(user_account.identifier, expected_sid) self.assertEqual(user_account.username, 'rsydow') self.assertEqual(user_account.user_directory, 'C:\\Users\\rsydow')
def testParseKey(self): """Tests the _ParseKey function.""" plugin = windows.WindowsUserAccountsPlugin() knowledge_base = self._RunPreprocessorPluginOnWindowsRegistryValueSoftware( plugin) users = sorted(knowledge_base.user_accounts, key=lambda user_account: user_account.identifier) self.assertIsNotNone(users) self.assertEqual(len(users), 11) user_account = users[9] expected_sid = u'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')
def testParseKey(self): """Tests the _ParseKey function.""" test_file_path = self._GetTestFilePath(['SOFTWARE']) self._SkipIfPathNotExists(test_file_path) plugin = windows.WindowsUserAccountsPlugin() knowledge_base_object = ( self._RunPreprocessorPluginOnWindowsRegistryValueSoftware(plugin)) user_accounts = sorted( knowledge_base_object.user_accounts, key=lambda user_account: user_account.identifier) self.assertIsNotNone(user_accounts) self.assertEqual(len(user_accounts), 11) user_account = user_accounts[9] expected_sid = 'S-1-5-21-2036804247-3058324640-2116585241-1114' self.assertEqual(user_account.identifier, expected_sid) self.assertEqual(user_account.username, 'rsydow') self.assertEqual(user_account.user_directory, 'C:\\Users\\rsydow')