def test_init_state(self): e = Event('a') self.assertEqual('a', e.subject) self.assertIsNone(e.name) self.assertEqual({}, e.parameters) self.assertFalse(e.is_processed()) self.assertFalse(e.is_propagation_stopped()) e = Event('a', {'a': 1}) self.assertEqual({'a': 1}, e.parameters)
def test_mark_processed_changes_state_of_object(self): e = Event(None) self.assertFalse(e.is_processed()) e.mark_processed() self.assertTrue(e.is_processed())