Test a mixture of failing and succeeding hooks.
()
| 54 | nt.assert_true(fail2.called) |
| 55 | |
| 56 | def test_command_chain_dispatcher_fofo(): |
| 57 | """Test a mixture of failing and succeeding hooks.""" |
| 58 | fail1 = Fail(u'fail1') |
| 59 | fail2 = Fail(u'fail2') |
| 60 | okay1 = Okay(u'okay1') |
| 61 | okay2 = Okay(u'okay2') |
| 62 | |
| 63 | dp = CommandChainDispatcher([(0, fail1), |
| 64 | # (5, okay1), # add this later |
| 65 | (10, fail2), |
| 66 | (15, okay2)]) |
| 67 | dp.add(okay1, 5) |
| 68 | |
| 69 | nt.assert_equal(dp(), u'okay1') |
| 70 | |
| 71 | nt.assert_true(fail1.called) |
| 72 | nt.assert_true(okay1.called) |
| 73 | nt.assert_false(fail2.called) |
| 74 | nt.assert_false(okay2.called) |
| 75 | |
| 76 | def test_command_chain_dispatcher_eq_priority(): |
| 77 | okay1 = Okay(u'okay1') |
nothing calls this directly
no test coverage detected