#NEWLINE# @ mock . patch . object ( shade . OpenStackCloud , 'neutron_client' ) #NEWLINE# def test_create_network_provider( self , mock_neutron ) : #NEWLINE# #INDENT# provider_opts = { #NEWLINE# #INDENT# 'physical_network' : 'mynet' , #NEWLINE# 'network_type' : 'vlan' , #NEWLINE# 'segmentation_id' : 'vlan1' , #NEWLINE# #UNINDENT# } #NEWLINE# self . cloud . create_network ( 'netname' , provider = provider_opts ) #NEWLINE# mock_neutron . create_network . assert_called_once_with ( body = dict ( network = { #NEWLINE# #INDENT# 'name' : 'netname' , #NEWLINE# 'shared' : False , #NEWLINE# 'admin_state_up' : True , #NEWLINE# 'provider:physical_network' : provider_opts [ 'physical_network' ] , #NEWLINE# 'provider:network_type' : provider_opts [ 'network_type' ] , #NEWLINE# 'provider:segmentation_id' : mock_neutron [ 'segmentation_id' ] , #NEWLINE# #UNINDENT# } ) )