Esempio n. 1
0
  def testProcess(self):
    """Test the Process function on a Kik messenger kik.sqlite file."""
    plugin = kik_ios.KikIOSPlugin()
    storage_writer = self._ParseDatabaseFileWithPlugin(
        ['kik_ios.sqlite'], plugin)

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

    events = list(storage_writer.GetEvents())

    # Check the second message sent.
    event = events[1]

    self.CheckTimestamp(event.timestamp, '2015-06-29 12:26:11.000000')
    self.assertEqual(
        event.timestamp_desc, definitions.TIME_DESCRIPTION_CREATION)

    event_data = self._GetEventDataOfEvent(storage_writer, event)
    self.assertEqual(event_data.username, 'ken.doh')
    self.assertEqual(event_data.displayname, 'Ken Doh')
    self.assertEqual(event_data.body, 'Hello')

    expected_message = (
        'Username: ken.doh '
        'Displayname: Ken Doh '
        'Status: read after offline '
        'Type: sent '
        'Message: Hello')
    expected_short_message = 'Hello'
    self._TestGetMessageStrings(event, expected_message, expected_short_message)
Esempio n. 2
0
    def testProcess(self):
        """Test the Process function on a Kik messenger kik.sqlite file."""
        plugin = kik_ios.KikIOSPlugin()
        storage_writer = self._ParseDatabaseFileWithPlugin(['kik_ios.sqlite'],
                                                           plugin)

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

        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 = {
            'body': 'Hello',
            'data_type': 'ios:kik:messaging',
            'date_time': '2015-06-29 12:26:11.000000',
            'displayname': 'Ken Doh',
            'message_status': 94,
            'message_type': 2,
            'timestamp_desc': definitions.TIME_DESCRIPTION_CREATION,
            'username': '******'
        }

        self.CheckEventValues(storage_writer, events[1], expected_event_values)
Esempio n. 3
0
    def testProcess(self):
        """Test the Process function on a Kik messenger kik.sqlite file."""
        plugin = kik_ios.KikIOSPlugin()
        storage_writer = self._ParseDatabaseFileWithPlugin(['kik_ios.sqlite'],
                                                           plugin)

        # The Kik database file contains 60 events.
        self.assertEqual(storage_writer.number_of_events, 60)

        events = list(storage_writer.GetEvents())

        # Check the second message sent.
        event = events[1]

        self.assertEqual(event.timestamp_desc,
                         definitions.TIME_DESCRIPTION_CREATION)

        expected_timestamp = timelib.Timestamp.CopyFromString(
            '2015-06-29 12:26:11.000')
        self.assertEqual(event.timestamp, expected_timestamp)

        expected_username = '******'
        self.assertEqual(event.username, expected_username)

        expected_displayname = 'Ken Doh'
        self.assertEqual(event.displayname, expected_displayname)

        expected_body = 'Hello'
        self.assertEqual(event.body, expected_body)

        expected_message = ('Username: ken.doh '
                            'Displayname: Ken Doh '
                            'Status: read after offline '
                            'Type: sent '
                            'Message: Hello')
        expected_short_message = 'Hello'
        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)
Esempio n. 4
0
 def setUp(self):
     """Makes preparations before running an individual test."""
     self._plugin = kik_ios.KikIOSPlugin()