コード例 #1
0
ファイル: boto_vpc_test.py プロジェクト: thedrow/salt
 def test_get_subnet_association_multiple_subnets_same_vpc(self):
     '''
     tests that given multiple subnet ids in the same VPC that the VPC ID is
     returned.
     '''
     vpc = self._create_vpc()
     subnet_a = self._create_subnet(vpc.id, '10.0.0.0/25')
     subnet_b = self._create_subnet(vpc.id, '10.0.0.128/25')
     subnet_association = boto_vpc.get_subnet_association(
         [subnet_a.id, subnet_b.id], **conn_parameters)
     self.assertEqual(vpc.id, subnet_association)
コード例 #2
0
ファイル: boto_vpc_test.py プロジェクト: thedrow/salt
 def test_get_subnet_association_single_subnet(self):
     '''
     tests that given multiple subnet ids in the same VPC that the VPC ID is
     returned. The test is valuable because it uses a string as an argument
     to subnets as opposed to a list.
     '''
     vpc = self._create_vpc()
     subnet = self._create_subnet(vpc.id)
     subnet_association = boto_vpc.get_subnet_association(subnets=subnet.id,
                                                          **conn_parameters)
     self.assertEqual(vpc.id, subnet_association)
コード例 #3
0
ファイル: boto_vpc.py プロジェクト: s7726/salt
 def test_get_subnet_association_single_subnet(self):
     '''
     tests that given multiple subnet ids in the same VPC that the VPC ID is
     returned. The test is valuable because it uses a string as an argument
     to subnets as opposed to a list.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc = conn.create_vpc('10.0.0.0/24')
     subnet = conn.create_subnet(vpc.id, '10.0.0.0/25')
     subnet_assocation = boto_vpc.get_subnet_association(subnets=subnet.id,
                                                         **conn_parameters)
     self.assertEqual(vpc.id, subnet_assocation)
コード例 #4
0
ファイル: boto_vpc_test.py プロジェクト: thedrow/salt
 def test_get_subnet_association_multiple_subnets_different_vpc(self):
     '''
     tests that given multiple subnet ids in different VPCs that False is
     returned.
     '''
     vpc_a = self._create_vpc()
     vpc_b = self.conn.create_vpc(cidr_block)
     subnet_a = self._create_subnet(vpc_a.id, '10.0.0.0/24')
     subnet_b = self._create_subnet(vpc_b.id, '10.0.0.0/24')
     subnet_assocation = boto_vpc.get_subnet_association(
         [subnet_a.id, subnet_b.id], **conn_parameters)
     self.assertFalse(subnet_assocation)
コード例 #5
0
 def test_get_subnet_association_multiple_subnets_same_vpc(self):
     '''
     tests that given multiple subnet ids in the same VPC that the VPC ID is
     returned.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc = conn.create_vpc('10.0.0.0/24')
     subnet_a = conn.create_subnet(vpc.id, '10.0.0.0/25')
     subnet_b = conn.create_subnet(vpc.id, '10.0.0.128/25')
     subnet_assocation = boto_vpc.get_subnet_association([subnet_a.id, subnet_b.id],
                                                         **conn_parameters)
     self.assertEqual(vpc.id, subnet_assocation)
コード例 #6
0
 def test_get_subnet_association_single_subnet(self):
     '''
     tests that given multiple subnet ids in the same VPC that the VPC ID is
     returned. The test is valuable because it uses a string as an argument
     to subnets as opposed to a list.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc = conn.create_vpc('10.0.0.0/24')
     subnet = conn.create_subnet(vpc.id, '10.0.0.0/25')
     subnet_assocation = boto_vpc.get_subnet_association(subnets=subnet.id,
                                                         **conn_parameters)
     self.assertEqual(vpc.id, subnet_assocation)
コード例 #7
0
ファイル: boto_vpc.py プロジェクト: s7726/salt
 def test_get_subnet_association_multiple_subnets_different_vpc(self):
     '''
     tests that given multiple subnet ids in different VPCs that False is
     returned.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc_a = conn.create_vpc('10.0.0.0/24')
     vpc_b = conn.create_vpc('10.0.0.0/24')
     subnet_a = conn.create_subnet(vpc_a.id, '10.0.0.0/24')
     subnet_b = conn.create_subnet(vpc_b.id, '10.0.0.0/24')
     subnet_assocation = boto_vpc.get_subnet_association(
         [subnet_a.id, subnet_b.id], **conn_parameters)
     self.assertFalse(subnet_assocation)
コード例 #8
0
 def test_get_subnet_association_multiple_subnets_different_vpc(self):
     '''
     tests that given multiple subnet ids in different VPCs that False is
     returned.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc_a = conn.create_vpc('10.0.0.0/24')
     vpc_b = conn.create_vpc('10.0.0.0/24')
     subnet_a = conn.create_subnet(vpc_a.id, '10.0.0.0/24')
     subnet_b = conn.create_subnet(vpc_b.id, '10.0.0.0/24')
     subnet_assocation = boto_vpc.get_subnet_association([subnet_a.id, subnet_b.id],
                                                         **conn_parameters)
     self.assertFalse(subnet_assocation)