def testProcess(self): """Tests the Process function on a MacOS Document Versions file.""" plugin = mac_document_versions.MacDocumentVersionsPlugin() storage_writer = self._ParseDatabaseFileWithPlugin( ['document_versions.sql'], plugin) self.assertEqual(storage_writer.number_of_events, 4) events = list(storage_writer.GetEvents()) # Check the first page visited entry. event = events[0] self.CheckTimestamp(event.timestamp, '2014-01-21 02:03:00.000000') self.assertEqual( event.timestamp_desc, definitions.TIME_DESCRIPTION_CREATION) self.assertEqual(event.name, 'Spain is beautiful.rtf') self.assertEqual(event.path, '/Users/moxilo/Documents') self.assertEqual(event.user_sid, '501') expected_version_path = ( '/.DocumentRevisions-V100/PerUID/501/1/' 'com.apple.documentVersions/' '08CFEB5A-5CDA-486F-AED5-EA35BF3EE4C2.rtf') self.assertEqual(event.version_path, expected_version_path) expected_message = ( 'Version of [{0:s}] ({1:s}) stored in {2:s} by {3:s}'.format( event.name, event.path, event.version_path, event.user_sid)) expected_short_message = 'Stored a document version of [{0:s}]'.format( event.name) self._TestGetMessageStrings(event, expected_message, expected_short_message)
def testProcess(self): """Tests the Process function on a MacOS Document Versions file.""" plugin = mac_document_versions.MacDocumentVersionsPlugin() storage_writer = self._ParseDatabaseFileWithPlugin( ['document_versions.sql'], plugin) self.assertEqual(storage_writer.number_of_events, 4) self.assertEqual(storage_writer.number_of_extraction_warnings, 0) self.assertEqual(storage_writer.number_of_recovery_warnings, 0) events = list(storage_writer.GetEvents()) expected_event_values = { 'data_type': 'mac:document_versions:file', 'date_time': '2014-01-21 02:03:00', 'name': 'Spain is beautiful.rtf', 'path': '/Users/moxilo/Documents', 'timestamp_desc': definitions.TIME_DESCRIPTION_CREATION, 'user_sid': '501', 'version_path': ('/.DocumentRevisions-V100/PerUID/501/1/com.apple.documentVersions/' '08CFEB5A-5CDA-486F-AED5-EA35BF3EE4C2.rtf') } self.CheckEventValues(storage_writer, events[0], expected_event_values)
def setUp(self): """Sets up the needed objects used throughout the test.""" self._plugin = mac_document_versions.MacDocumentVersionsPlugin()
def setUp(self): """Sets up the needed objects used throughout the test.""" pre_obj = event.PreprocessObject() self._plugin = mac_document_versions.MacDocumentVersionsPlugin(pre_obj)
def setUp(self): """Makes preparations before running an individual test.""" self._plugin = mac_document_versions.MacDocumentVersionsPlugin()