예제 #1
0
 def test_block_device(self):
     block_device = Mock()
     block_device_properties = (
         'ephemeral_name',
         'snapshot_id',
         'size',
         'delete_on_termination',
         'volume_type'
     )
     for prop in block_device_properties:
         setattr(block_device, prop, 'test')
     values = {"test": block_device}
     result = "test=test:test:test:test:test"
     self.assertEquals(EC2.block_device(values), result)
     self.assertEquals(EC2.block_device(None), '')
예제 #2
0
 def test_reserved_instances_rm(self):
     states = {}
     self.assertEquals(
         EC2.reserved_instances_rm(
             'test', self.tests, states).__dict__['maps'][0].title,
         sentinel.id
     )
     self.assertEquals(states.get('sentinel.id'), 1000)
예제 #3
0
 def test_elastic_ips_rm(self):
     self.assertEquals(
         EC2.elastic_ips_rm('test', self.tests).__dict__['maps'][0].title,
         sentinel.public_ip
     )
예제 #4
0
 def test_images_rm(self):
     self.assertEquals(
         EC2.images_rm('test', self.tests).__dict__['maps'][0].title,
         sentinel.name
     )
예제 #5
0
 def test_vpn_queues_rm(self):
     self.tests[0].name = 'name'
     self.assertEquals(
         EC2.vpn_queues_rm('test', self.tests).__dict__['maps'][0].title,
         'name',
     )
예제 #6
0
 def test_vpn_gateways_rm(self):
     self.assertEquals(
         EC2.vpn_gateways_rm('test', self.tests).__dict__['maps'][0].state,
         sentinel.state
     )
예제 #7
0
 def test_format_size(self):
     self.assertEquals(EC2.format_size(8), '8 GB')
     self.assertEquals(EC2.format_size(1024), '1 TB')
     self.assertEquals(EC2.format_size(None), None)
예제 #8
0
 def test_path_to_pem(self):
     values = ['{"region_name":"test","pem_path":"path"}']
     self.assertEquals(EC2.path_to_pem('test', values), 'path')
     self.assertEquals(EC2.path_to_pem('test1', values), '')
예제 #9
0
 def test_check_tag(self):
     tags = {u'tag': u'test'}
     tags1 = {u'tag': u'test2'}
     value = 'tag: test; tag1: test1; '
     self.assertEquals(EC2.check_tag(value, tags), True)
     self.assertEquals(EC2.check_tag(value, tags1), False)
예제 #10
0
 def test_tags_string(self):
     tags = {u'tag': u'test', u'tag1': u'test1'}
     self.assertEquals(EC2.tags_string(tags), 'tag: test, tag1: test1;')
예제 #11
0
    def test_s3buckets_rm(self):
        self.tests[0].creation_date = 'DDTHH.asdf'
        map = EC2.s3buckets_rm(self.tests).__dict__['maps'][0]

        self.assertEquals(map.title, sentinel.name)
        self.assertEquals(map.creation_date, 'DD HH')
예제 #12
0
 def test_reserved_instances_rm(self):
     self.assertEquals(
         EC2.reserved_instances_rm('test', self.tests).__dict__['maps'][0].title,
         sentinel.id
     )