def test_command_chain_dispatcher_ff():
 fail1 = Fail(u'fail1')
 fail2 = Fail(u'fail2')
 dp = CommandChainDispatcher([(0, fail1), (10, fail2)])
 try:
  dp()
 except TryNext as e:
  nt.assert_equal(str(e), u'fail2')
 else:
  assert False, 'Expected exception was not raised.'
 nt.assert_true(fail1.called)
 nt.assert_true(fail2.called)

def test_command_chain_dispatcher_ff ( ) : fail1 = Fail ( u'fail1' ) fail2 = Fail ( u'fail2' ) dp = CommandChainDispatcher ( [ ( 0 , fail1 ) , ( 10 , fail2 ) ] ) try : dp ( ) except TryNext as e : nt . assert_equal ( str ( e ) , u'fail2' ) else : assert False , 'Expected exception was not raised.' nt . assert_true ( fail1 . called ) nt . assert_true ( fail2 . called )
test two failing hooks .