def test_notify(self): lm = ListenerManager() mcl1 = MethCallLogger() mcl2 = MethCallLogger() lm.addListener(mcl1) lm.addListener(mcl2) lm.notify("mockIP", "mockEvent") self.assertTrue(mcl1.was_called) self.assertTrue(mcl2.was_called)
def test_removeListener(self): lm = ListenerManager() mcl = MethCallLogger() lm.addListener(mcl) lm.removeListener(mcl) self.assertEqual([], lm.listeners)