#NEWLINE# def test_create_ha_port_and_bind_catch_router_not_found( self ) : #NEWLINE# #INDENT# router = self . _create_ha_router ( tenant_id = 'foo_tenant' ) #NEWLINE# agent = { #NEWLINE# #INDENT# 'id' : 'foo_agent' , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch . object ( self . plugin . router_scheduler , 'bind_router' ) as bind_router : #NEWLINE# #INDENT# with mock . patch . object ( self . plugin , 'add_ha_port' , side_effect = l3 . RouterNotFound ( router_id = 'foo_router' ) ) : #NEWLINE# #INDENT# self . plugin . router_scheduler . create_ha_port_and_bind ( self . plugin , self . adminContext , router [ 'id' ] , router [ 'tenant_id' ] , bind_router ) #NEWLINE# self . assertFalse ( bind_router . called )