Esempio n. 1
0
def get_event_fixture(metadata, event_name=None):
    gob_event = random_gob_event() if event_name is None else _get_event(
        event_name)
    data = get_event_data_fixture(gob_event, metadata)
    data["_last_event"] = None
    data["_hash"] = None
    return gob_event.create_event(data["_tid"], data, '0.9')
Esempio n. 2
0
    def test_GobEvent(self):
        event = fixtures.get_event_fixture()
        metadata = fixtures.get_metadata_fixture()

        gob_event = GobEvent(event, metadata)

        self.assertIsInstance(gob_event, events._get_event(event['event']))
        self.assertEqual(event['data'], gob_event._data)
        self.assertEqual(metadata, gob_event._metadata)
Esempio n. 3
0
    def test_get_event(self):
        for event in events.GOB_EVENTS:
            self.assertEqual(events._get_event(f"{event.name}"), event)

        with self.assertRaises(GOBException):
            events._get_event(fixtures.random_string())