Ejemplo n.º 1
0
 def test_that_when_checking_if_a_vpc_exists_but_providing_no_filters_the_vpc_exists_method_raises_a_salt_invocation_error(
         self):
     with self.assertRaisesRegexp(
             SaltInvocationError,
             'At least on of the following must be specified: vpc id, name or tags.'
     ):
         boto_vpc.exists(**conn_parameters)
Ejemplo n.º 2
0
    def test_that_when_checking_if_a_vpc_exists_by_name_and_a_vpc_exists_the_vpc_exists_method_returns_true(
            self):
        self._create_vpc(name='test')

        vpc_exists = boto_vpc.exists(name='test', **conn_parameters)

        self.assertTrue(vpc_exists)
Ejemplo n.º 3
0
    def test_that_when_checking_if_a_vpc_exists_by_id_and_a_vpc_does_not_exist_the_vpc_exists_method_returns_false(
            self):
        self._create_vpc(
        )  # Created to ensure that the filters are applied correctly
        vpc_exists = boto_vpc.exists(vpc_id='fake', **conn_parameters)

        self.assertFalse(vpc_exists)
Ejemplo n.º 4
0
    def test_that_when_checking_if_a_vpc_exists_by_id_and_a_vpc_exists_the_vpc_exists_method_returns_true(
            self):
        vpc = self._create_vpc()

        vpc_exists = boto_vpc.exists(vpc_id=vpc.id, **conn_parameters)

        self.assertTrue(vpc_exists)
Ejemplo n.º 5
0
 def test_exists_true(self):
     '''
     tests True existence of a VPC.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc = conn.create_vpc('10.0.0.0/24')
     vpc_exists = boto_vpc.exists(vpc.id, **conn_parameters)
     self.assertTrue(vpc_exists)
Ejemplo n.º 6
0
    def test_that_when_checking_if_a_vpc_exists_by_tags_and_a_vpc_exists_the_vpc_exists_method_returns_true(
            self):
        self._create_vpc(tags={'test': 'testvalue'})

        vpc_exists = boto_vpc.exists(tags={'test': 'testvalue'},
                                     **conn_parameters)

        self.assertTrue(vpc_exists)
 def test_exists_true(self):
     '''
     tests True existence of a VPC.
     '''
     conn = boto.vpc.connect_to_region(region)
     vpc = conn.create_vpc('10.0.0.0/24')
     vpc_exists = boto_vpc.exists(vpc.id, **conn_parameters)
     self.assertTrue(vpc_exists)