Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def test_removeListener(self):
     lm = ListenerManager()
     mcl = MethCallLogger()
     lm.addListener(mcl)
     lm.removeListener(mcl)
     self.assertEqual([], lm.listeners)
Exemplo n.º 4
0
 def test_removeListener(self):
     lm = ListenerManager()
     mcl = MethCallLogger()
     lm.addListener(mcl)
     lm.removeListener(mcl)
     self.assertEqual([], lm.listeners)