def test_root_event_asdict_should_return_a_dict(self):
        """
        Test asDict(self)
        """
        event_data = ''
        module = ''
        source_event = ''

        event_type = 'ROOT'
        evt = SpiderFootEvent(event_type, event_data, module, source_event)
        evt_dict = evt.asDict()

        self.assertEqual(dict, type(evt_dict))
    def test_asdict_root_event_should_return_event_as_a_dict(self):
        """
        Test asDict(self)
        """
        event_data = 'example event data'
        module = 'example module data'
        source_event = ''

        event_type = 'ROOT'
        evt = SpiderFootEvent(event_type, event_data, module, source_event)
        evt_dict = evt.asDict()

        self.assertIsInstance(evt_dict, dict)
        self.assertEqual(evt_dict['type'], event_type)
        self.assertEqual(evt_dict['data'], event_data)
        self.assertEqual(evt_dict['module'], module)
Exemple #3
0
    def test_asdict_nonroot_event_should_return_a_dict(self):
        """
        Test asDict(self)
        """
        event_data = ''
        module = ''
        source_event = ''

        event_type = 'ROOT'
        source_event = SpiderFootEvent(event_type, event_data, module,
                                       source_event)

        event_type = 'example non-root event type'
        evt = SpiderFootEvent(event_type, event_data, module, source_event)
        evt_dict = evt.asDict()

        self.assertIsInstance(evt_dict, dict)