Example #1
0
    def testProcess(self):
        """Test the Process function on a iMessage chat.db file."""
        plugin = imessage.IMessagePlugin()
        storage_writer = self._ParseDatabaseFileWithPlugin(
            ['imessage_chat.db'], plugin)

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

        events = list(storage_writer.GetEvents())

        # Check the eighth message sent.
        event = events[7]

        self.CheckTimestamp(event.timestamp, '2015-11-30 10:48:40.000000')
        self.assertEqual(event.timestamp_desc,
                         definitions.TIME_DESCRIPTION_CREATION)

        self.assertEqual(event.imessage_id, '*****@*****.**')
        self.assertEqual(event.read_receipt, 1)
        self.assertEqual(event.message_type, 0)

        expected_text = 'Did you try to send me a message?'
        self.assertEqual(event.text, expected_text)

        expected_message = (
            'iMessage ID: [email protected] '
            'Read Receipt: True '
            'Message Type: Received '
            'Service: iMessage '
            'Message Content: Did you try to send me a message?')
        expected_short_message = 'Did you try to send me a message?'
        self._TestGetMessageStrings(event, expected_message,
                                    expected_short_message)
Example #2
0
    def testProcess(self):
        """Test the Process function on a iMessage chat.db file."""
        plugin = imessage.IMessagePlugin()
        storage_writer = self._ParseDatabaseFileWithPlugin(
            ['imessage_chat.db'], plugin)

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

        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': 'imessage:event:chat',
            'date_time': '2015-11-30 10:48:40.000000',
            'imessage_id': '*****@*****.**',
            'message_type': 0,
            'read_receipt': 1,
            'service': 'iMessage',
            'text': 'Did you try to send me a message?',
            'timestamp_desc': definitions.TIME_DESCRIPTION_CREATION
        }

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