Test two failing hooks
()
| 37 | #----------------------------------------------------------------------------- |
| 38 | |
| 39 | def test_command_chain_dispatcher_ff(): |
| 40 | """Test two failing hooks""" |
| 41 | fail1 = Fail(u'fail1') |
| 42 | fail2 = Fail(u'fail2') |
| 43 | dp = CommandChainDispatcher([(0, fail1), |
| 44 | (10, fail2)]) |
| 45 | |
| 46 | try: |
| 47 | dp() |
| 48 | except TryNext as e: |
| 49 | nt.assert_equal(str(e), u'fail2') |
| 50 | else: |
| 51 | assert False, "Expected exception was not raised." |
| 52 | |
| 53 | nt.assert_true(fail1.called) |
| 54 | nt.assert_true(fail2.called) |
| 55 | |
| 56 | def test_command_chain_dispatcher_fofo(): |
| 57 | """Test a mixture of failing and succeeding hooks.""" |
nothing calls this directly
no test coverage detected