예제 #1
0
 def test_fire_existing(self):
     em = EventManager()
     event = em.get('some_event')
     self.assertEqual(event._fireCount, 0)
     em.fire('some_event')
     self.assertEqual(event._fireCount, 1)
     event.fire()
     self.assertEqual(event._fireCount, 2)
     event()
     self.assertEqual(event._fireCount, 3)
     em.fire('some_event')
     self.assertEqual(event._fireCount, 4)
예제 #2
0
 def test_fire_existing(self):
     em = EventManager()
     event = em.get('some_event')
     self.assertEqual(event._fireCount, 0)
     em.fire('some_event')
     self.assertEqual(event._fireCount, 1)
     event.fire()
     self.assertEqual(event._fireCount, 2)
     event()
     self.assertEqual(event._fireCount, 3)
     em.fire('some_event')
     self.assertEqual(event._fireCount, 4)
예제 #3
0
 def test_fire_doesnt_create_event(self):
     em = EventManager()
     em.fire('another', create=False)
     event = em.get('another')
     self.assertEqual(event._fireCount, 0)
예제 #4
0
 def test_fire_new(self):
     em = EventManager()
     em.fire('another')
     event = em.get('another')
     self.assertEqual(event._fireCount, 1)
예제 #5
0
 def test_fire_doesnt_create_event(self):
     em = EventManager()
     em.fire('another', create=False)
     event = em.get('another')
     self.assertEqual(event._fireCount, 0)
예제 #6
0
 def test_fire_new(self):
     em = EventManager()
     em.fire('another')
     event = em.get('another')
     self.assertEqual(event._fireCount, 1)