#NEWLINE# def test_list_security_group_with_no_port_range_and_not_tcp_udp_icmp( self ) : #NEWLINE# #INDENT# sg1 = { #NEWLINE# #INDENT# 'description' : 'default' , #NEWLINE# 'id' : '07f1362f-34f6-4136-819a-2dcde112269e' , #NEWLINE# 'name' : 'default' , #NEWLINE# 'tenant_id' : 'c166d9316f814891bcb66b96c4c891d6' , #NEWLINE# 'security_group_rules' : [ { #NEWLINE# #INDENT# 'direction' : 'ingress' , #NEWLINE# 'ethertype' : 'IPv4' , #NEWLINE# 'id' : '0a4647f1-e1aa-488d-90e1-97a7d0293beb' , #NEWLINE# 'port_range_max' : None , #NEWLINE# 'port_range_min' : None , #NEWLINE# 'protocol' : '51' , #NEWLINE# 'remote_group_id' : None , #NEWLINE# 'remote_ip_prefix' : None , #NEWLINE# 'security_group_id' : '07f1362f-34f6-4136-819a-2dcde112269e' , #NEWLINE# 'tenant_id' : 'c166d9316f814891bcb66b96c4c891d6' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . mocked_client . list_security_groups . return_value = { #NEWLINE# #INDENT# 'security_groups' : [ sg1 ] , #NEWLINE# #UNINDENT# } #NEWLINE# sg_api = neutron_driver . SecurityGroupAPI ( ) #NEWLINE# result = sg_api . list ( self . context ) #NEWLINE# expected = [ { #NEWLINE# #INDENT# 'rules' : [ { #NEWLINE# #INDENT# 'from_port' : ( - 1 ) , #NEWLINE# 'protocol' : '51' , #NEWLINE# 'to_port' : ( - 1 ) , #NEWLINE# 'parent_group_id' : '07f1362f-34f6-4136-819a-2dcde112269e' , #NEWLINE# 'cidr' : '0.0.0.0/0' , #NEWLINE# 'group_id' : None , #NEWLINE# 'id' : '0a4647f1-e1aa-488d-90e1-97a7d0293beb' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'project_id' : 'c166d9316f814891bcb66b96c4c891d6' , #NEWLINE# 'id' : '07f1362f-34f6-4136-819a-2dcde112269e' , #NEWLINE# 'name' : 'default' , #NEWLINE# 'description' : 'default' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertEqual ( expected , result ) #NEWLINE# self . mocked_client . list_security_groups . assert_called_once_with ( )