def test_exception(self): with self.assertRaises(Exception): EventFactory.create('unknown', 10)
def test_create(self): event = EventFactory.create('web', 35) self.assertEqual(event.get_event_type(), 'web') self.assertEqual(event.score, 35)
def add_event(self, event_type, score): self.events[event_type] = EventFactory.create(event_type, score)