Пример #1
0
  def testProcess(self):
    """Tests the process function on a Safari History.db database file."""
    plugin = safari.SafariHistoryPluginSqlite()
    storage_writer = self._ParseDatabaseFileWithPlugin(['History.db'], plugin)

    self.assertEqual(storage_writer.number_of_warnings, 0)
    self.assertEqual(storage_writer.number_of_events, 25)

    events = list(storage_writer.GetEvents())

    # Check the first page visited entry
    event = events[1]

    self.CheckTimestamp(event.timestamp, '2017-11-09 21:24:28.829571')
    self.assertEqual(
        event.timestamp_desc, definitions.TIME_DESCRIPTION_LAST_VISITED)

    event_data = self._GetEventDataOfEvent(storage_writer, event)
    self.assertEqual(event_data.url, 'http://facebook.com/')
    self.assertEqual(event_data.title, '')
    self.assertFalse(event_data.was_http_non_get)

    expected_message = (
        'URL: http://facebook.com/ '
        '[count: 2] '
        'http_non_get: False')

    self._TestGetMessageStrings(event_data, expected_message, expected_message)
Пример #2
0
    def testProcess(self):
        """Tests the process function on a Safari History.db database file."""

        plugin = safari.SafariHistoryPluginSqlite()
        storage_writer = self._ParseDatabaseFileWithPlugin(['History.db'],
                                                           plugin)

        # The History file contains 25 events
        self.assertEqual(storage_writer.number_of_events, 25)

        events = list(storage_writer.GetEvents())

        # Check the first page visited entry
        event = events[1]

        self.CheckTimestamp(event.timestamp, '2017-11-09 21:24:28.829571')
        self.assertEqual(event.timestamp_desc,
                         definitions.TIME_DESCRIPTION_LAST_VISITED)

        expected_url = 'http://facebook.com/'
        self.assertEqual(event.url, expected_url)

        expected_title = ''
        self.assertEqual(event.title, expected_title)

        expected_message = (
            'URL: {0:s} [count: 2] http_non_get: False').format(expected_url)

        self._TestGetMessageStrings(event, expected_message, expected_message)
Пример #3
0
  def testProcess(self):
    """Tests the process function on a Safari History.db database file."""
    plugin = safari.SafariHistoryPluginSqlite()
    storage_writer = self._ParseDatabaseFileWithPlugin(['History.db'], plugin)

    number_of_events = storage_writer.GetNumberOfAttributeContainers('event')
    self.assertEqual(number_of_events, 25)

    number_of_warnings = storage_writer.GetNumberOfAttributeContainers(
        'extraction_warning')
    self.assertEqual(number_of_warnings, 0)

    number_of_warnings = storage_writer.GetNumberOfAttributeContainers(
        'recovery_warning')
    self.assertEqual(number_of_warnings, 0)

    events = list(storage_writer.GetEvents())

    expected_event_values = {
        'data_type': 'safari:history:visit_sqlite',
        'date_time': '2017-11-09 21:24:28.829571',
        'timestamp_desc': definitions.TIME_DESCRIPTION_LAST_VISITED,
        'title': '',
        'url': 'http://facebook.com/',
        'visit_count': 2,
        'was_http_non_get': False}

    self.CheckEventValues(storage_writer, events[1], expected_event_values)