#NEWLINE# @ mock_ec2 #NEWLINE# def test_elastic_network_interfaces_with_groups( ) : #NEWLINE# #INDENT# conn = boto . connect_vpc ( 'the_key' , 'the_secret' ) #NEWLINE# vpc = conn . create_vpc ( '10.0.0.0/16' ) #NEWLINE# subnet = conn . create_subnet ( vpc . id , '10.0.0.0/18' ) #NEWLINE# security_group1 = conn . create_security_group ( 'test security group #1' , 'this is a test security group' ) #NEWLINE# security_group2 = conn . create_security_group ( 'test security group #2' , 'this is a test security group' ) #NEWLINE# conn . create_network_interface ( subnet . id , groups = [ security_group1 . id , security_group2 . id ] ) #NEWLINE# all_enis = conn . get_all_network_interfaces ( ) #NEWLINE# all_enis . should . have . length_of ( 1 ) #NEWLINE# eni = subnet [ 0 ] #NEWLINE# eni . groups . should . have . length_of ( 2 ) #NEWLINE# set ( [ group . id for group in eni . groups ] ) . should . equal ( set ( [ security_group1 . id , security_group2 . id ] ) )