#NEWLINE# def test_ha_router_create_failed_no_ha_network_delete( self ) : #NEWLINE# #INDENT# tenant_id = 'foo_tenant_id' #NEWLINE# nets_before = self . core_plugin . get_networks ( self . admin_ctx ) #NEWLINE# self . assertNotIn ( ( 'HA network tenant %s' % tenant_id ) , nets_before ) #NEWLINE# with mock . patch . object ( self . core_plugin , 'create_network' , side_effect = n_exc . NoNetworkAvailable ) : #NEWLINE# #INDENT# self . assertRaises ( n_exc . NoNetworkAvailable , self . _create_router , True , tenant_id ) #NEWLINE# nets_after = self . core_plugin . get_networks ( self . admin_ctx ) #NEWLINE# self . assertEqual ( nets_before , nets_after ) #NEWLINE# self . assertNotIn ( ( 'HA network tenant %s' % tenant_id ) , nets_after )