#NEWLINE# @ mock . patch ( 'cloudferry.lib.os.network.nova_network.NovaNetwork.get_security_groups' ) #NEWLINE# def test_upload_security_groups( self , mock_get ) : #NEWLINE# #INDENT# fake_existing_groups = [ self . sg1 ] #NEWLINE# fake_security_groups = [ self . sg1 , self . sg2 ] #NEWLINE# mock_get . return_value = fake_existing_groups #NEWLINE# self . nova_network_client . upload_security_groups ( fake_security_groups ) #NEWLINE# kwargs = { #NEWLINE# #INDENT# 'name' : 'fake_name_2' , #NEWLINE# 'description' : 'fake_description_2' , #NEWLINE# #UNINDENT# } #NEWLINE# self . nova_mock_client ( ) . security_groups . create . assert_called_once_with ( ** fake_existing_groups )