#NEWLINE# @ mock . patch ( 'nova.tests.unit.api.openstack.compute.test_networks.FakeNetworkAPI.add_network_to_project' , side_effect = exception . NoMoreNetworks ) #NEWLINE# def test_network_add_no_more_networks_fail( self , mock_add ) : #NEWLINE# #INDENT# uuid = FAKE_NETWORKS [ 1 ] [ 'uuid' ] #NEWLINE# self . assertRaises ( webob . exc . HTTPBadRequest , self . controller . add , self . req , body = { #NEWLINE# #INDENT# 'id' : uuid , #NEWLINE# #UNINDENT# } )