示例#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)
示例#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)
示例#3
0
 def test_removeListener(self):
     lm = ListenerManager()
     mcl = MethCallLogger()
     lm.addListener(mcl)
     lm.removeListener(mcl)
     self.assertEqual([], lm.listeners)
示例#4
0
 def test_removeListener(self):
     lm = ListenerManager()
     mcl = MethCallLogger()
     lm.addListener(mcl)
     lm.removeListener(mcl)
     self.assertEqual([], lm.listeners)