def testProcess(self): """Tests the Process function.""" plist_name = 'History.plist' plugin = safari.SafariHistoryPlugin() storage_writer = self._ParsePlistFileWithPlugin( plugin, [plist_name], plist_name) self.assertEqual(storage_writer.number_of_events, 18) # The order in which PlistParser generates events is nondeterministic # hence we sort the events. events = list(storage_writer.GetSortedEvents()) event = events[7] expected_timestamp = timelib.Timestamp.CopyFromString( '2013-07-08 17:31:00') self.assertEqual(event.timestamp, expected_timestamp) event = events[9] expected_url = 'http://netverslun.sci-mx.is/aminosyrur' self.assertEqual(event.url, expected_url) expected_message = ('Visited: {0:s} (Am\xedn\xf3s\xfdrur ) ' 'Visit Count: 1').format(expected_url) self._TestGetMessageStrings(event, expected_message, expected_message)
def testProcess(self): """Tests the Process function.""" plist_name = 'History.plist' plugin = safari.SafariHistoryPlugin() storage_writer = self._ParsePlistFileWithPlugin( plugin, [plist_name], plist_name) self.assertEqual(storage_writer.number_of_warnings, 0) self.assertEqual(storage_writer.number_of_events, 18) # The order in which PlistParser generates events is nondeterministic # hence we sort the events. events = list(storage_writer.GetSortedEvents()) expected_event_values = { 'data_type': 'safari:history:visit', 'timestamp': '2013-07-08 17:31:00.000000' } self.CheckEventValues(storage_writer, events[7], expected_event_values) expected_event_values = { 'data_type': 'safari:history:visit', 'title': 'Amínósýrur', 'url': 'http://netverslun.sci-mx.is/aminosyrur', 'visit_count': 1 } self.CheckEventValues(storage_writer, events[9], expected_event_values)
def testProcess(self): """Tests the Process function.""" plist_name = 'History.plist' plugin = safari.SafariHistoryPlugin() storage_writer = self._ParsePlistFileWithPlugin( plugin, [plist_name], plist_name) self.assertEqual(storage_writer.number_of_warnings, 0) self.assertEqual(storage_writer.number_of_events, 18) # The order in which PlistParser generates events is nondeterministic # hence we sort the events. events = list(storage_writer.GetSortedEvents()) expected_event_values = {'timestamp': '2013-07-08 17:31:00.000000'} self.CheckEventValues(storage_writer, events[7], expected_event_values) expected_url = 'http://netverslun.sci-mx.is/aminosyrur' expected_event_values = {'url': expected_url} self.CheckEventValues(storage_writer, events[9], expected_event_values) expected_message = ('Visited: {0:s} (Am\xedn\xf3s\xfdrur ) ' 'Visit Count: 1').format(expected_url) event_data = self._GetEventDataOfEvent(storage_writer, events[9]) self._TestGetMessageStrings(event_data, expected_message, expected_message)
def setUp(self): """Makes preparations before running an individual test.""" self._plugin = safari.SafariHistoryPlugin() self._parser = plist.PlistParser()
def setUp(self): """Sets up the needed objects used throughout the test.""" self._plugin = safari.SafariHistoryPlugin(None) self._parser = plist.PlistParser(event.PreprocessObject(), None)
def setUp(self): """Sets up the needed objects used throughout the test.""" self._plugin = safari.SafariHistoryPlugin() self._parser = plist.PlistParser()