Example #1
0
 def test_handle_does_not_invoke_handlers_if_stop_is_set(self):
     m = mock.Mock()
     h = handler.handler()
     h.chain(m)
     h.stop_propagation()
     h.handle("a")
     self.assertEqual(0, m.handle.call_count)
Example #2
0
 def test_handle_resets_stop_variable(self):
     m = mock.Mock()
     h = handler.handler()
     h.chain(m)
     h.stop_propagation()
     h.handle("a")
     self.assertFalse(h.stop)
Example #3
0
 def test_handle_call_all_handlers(self):
     m = mock.Mock()
     h = handler.handler()
     h.chain(m)
     h.handle("a")
     m.handle.assert_called_with("a")