def test_get_group_id_ec2_vpc(self):
     """
     tests that given a name of a group in EC2-VPC that the correct
     group id will be retrieved
     """
     group_name = _random_group_name()
     group_description = "test_get_group_id_ec2_vpc"
     conn = boto.ec2.connect_to_region(region, **boto_conn_parameters)
     group_classic = conn.create_security_group(name=group_name, description=group_description)
     # note that the vpc_id does not need to be created in order to create
     # a security group within the vpc when using moto
     group_vpc = conn.create_security_group(name=group_name, description=group_description, vpc_id=vpc_id)
     retrieved_group_id = boto_secgroup.get_group_id(group_name, group_vpc, **conn_parameters)
     self.assertEqual(group_vpc.id, retrieved_group_id)
 def test_get_group_id_ec2_vpc(self):
     """
     tests that given a name of a group in EC2-VPC that the correct
     group id will be retrieved
     """
     group_name = _random_group_name()
     group_description = "test_get_group_id_ec2_vpc"
     conn = boto.ec2.connect_to_region(region, **boto_conn_parameters)
     group_classic = conn.create_security_group(
         name=group_name, description=group_description)
     # note that the vpc_id does not need to be created in order to create
     # a security group within the vpc when using moto
     group_vpc = conn.create_security_group(name=group_name,
                                            description=group_description,
                                            vpc_id=vpc_id)
     retrieved_group_id = boto_secgroup.get_group_id(
         group_name, group_vpc, **conn_parameters)
     assert group_vpc.id == retrieved_group_id
Example #3
0
 def test_get_group_id_ec2_classic(self):
     '''
     tests that given a name of a group in EC2-Classic that the correct
     group id will be retrieved
     '''
     group_name = _random_group_name()
     group_description = 'test_get_group_id_ec2_classic'
     conn = boto.ec2.connect_to_region(region)
     group_classic = conn.create_security_group(
         name=group_name, description=group_description)
     # note that the vpc_id does not need to be created in order to create
     # a security group within the vpc when using moto
     group_vpc = conn.create_security_group(name=group_name,
                                            description=group_description,
                                            vpc_id=vpc_id)
     retrieved_group_id = boto_secgroup.get_group_id(
         group_name, **conn_parameters)
     self.assertEqual(group_classic.id, retrieved_group_id)