#NEWLINE# def test_securitygroup_create( self ) : #NEWLINE# #INDENT# fake_name = 'fake_name' #NEWLINE# fake_securitygroup_id = 'neutron_securitygroup_id' #NEWLINE# fake_sec_body = { #NEWLINE# #INDENT# 'security_group' : { #NEWLINE# #INDENT# 'name' : sec_group_dict , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# fake_sec_rule_body = { #NEWLINE# #INDENT# 'security_group_rule' : { #NEWLINE# #INDENT# 'direction' : 'ingress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'security_group_id' : fake_securitygroup_id , #NEWLINE# 'protocol' : 'tcp' , #NEWLINE# 'port_range_min' : '80' , #NEWLINE# 'port_range_max' : '80' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . neutron . create_security_group ( fake_sec_body ) . AndReturn ( fake_securitygroup ( ) ) #NEWLINE# self . neutron . create_security_group_rule ( fake_sec_rule_body ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# fake_rules = [ { #NEWLINE# #INDENT# 'protocol' : 'tcp' , #NEWLINE# 'port_range_max' : '80' , #NEWLINE# #UNINDENT# } ] #NEWLINE# sec_group_dict = self . securitygroup_client . securitygroup_create ( fake_name , fake_rules ) #NEWLINE# self . assertEqual ( sec_group_dict , { #NEWLINE# #INDENT# 'neutron_securitygroup_id' : fake_securitygroup_id , #NEWLINE# #UNINDENT# } )