def setUp(self): super(ImageViewTests, self).setUp() image_dict = {'name': 'visibleImage', 'container_format': 'novaImage'} self.visibleImage = api.Image(image_dict) self.visibleImage.id = '1' image_dict = {'name': 'invisibleImage', 'container_format': 'aki'} self.invisibleImage = api.Image(image_dict) self.invisibleImage.id = '2' self.images = (self.visibleImage, self.invisibleImage) flavor = api.Flavor(None) flavor.id = 1 flavor.name = 'm1.massive' flavor.vcpus = 1000 flavor.disk = 1024 flavor.ram = 10000 self.flavors = (flavor,) keypair = api.KeyPair(None) keypair.name = 'keyName' self.keypairs = (keypair,) security_group = api.SecurityGroup(None) security_group.name = 'default' self.security_groups = (security_group,)
def setUp(self): super(ImagesAndSnapshotsTests, self).setUp() snapshot_properties = api.glance.ImageProperties(None) snapshot_properties.image_type = u'snapshot' snapshot_dict = { 'name': u'snapshot', 'container_format': u'ami', 'id': 3 } snapshot = api.glance.Image(snapshot_dict) snapshot.properties = snapshot_properties self.snapshots = [snapshot] image_properties = api.glance.ImageProperties(None) image_properties.image_type = u'image' image_dict = { 'name': u'visibleImage', 'container_format': u'novaImage' } self.visibleImage = api.glance.Image(image_dict) self.visibleImage.id = '1' self.visibleImage.properties = image_properties image_dict = {'name': 'invisibleImage', 'container_format': 'aki'} self.invisibleImage = api.Image(image_dict) self.invisibleImage.id = '2' flavor = api.Flavor(None) flavor.id = 1 flavor.name = 'm1.massive' flavor.vcpus = 1000 flavor.disk = 1024 flavor.ram = 10000 self.flavors = (flavor, ) self.images = (self.visibleImage, self.invisibleImage) keypair = api.KeyPair(None) keypair.name = 'keyName' self.keypairs = (keypair, ) security_group = api.SecurityGroup(None) security_group.name = 'default' self.security_groups = (security_group, )
def setUp(self): super(ImageViewTests, self).setUp() image_dict = {'name': 'visibleImage', 'container_format': 'novaImage'} self.visibleImage = api.Image(image_dict) self.visibleImage.id = 1 image_dict = {'name': 'invisibleImage', 'container_format': 'aki'} self.invisibleImage = api.Image(image_dict) self.invisibleImage.id = 2 self.images = (self.visibleImage, self.invisibleImage) flavor = api.Flavor(None) flavor.id = 1 flavor.name = 'm1.massive' flavor.vcpus = 1000 flavor.disk = 1024 flavor.ram = 10000 self.flavors = (flavor,) keypair = api.KeyPair(None) keypair.name = 'keyName' self.keypairs = (keypair,) security_group = api.SecurityGroup(None) security_group.name = 'default' self.security_groups = (security_group,) volume = api.Volume(None) volume.id = 1 volume.name = 'vol' volume.status = 'available' volume.size = 40 volume.displayName = '' self.volumes = (volume,)
def setUp(self): super(SnapshotsViewTests, self).setUp() image_dict = { 'name': 'snapshot', 'container_format': 'novaImage', 'id': 3 } self.images = [image_dict] server = api.Server(None, self.request) server.id = 1 server.status = 'ACTIVE' server.name = 'sgoody' self.good_server = server server = api.Server(None, self.request) server.id = 2 server.status = 'BUILD' server.name = 'baddy' self.bad_server = server flavor = api.Flavor(None) flavor.id = 1 flavor.name = 'm1.massive' flavor.vcpus = 1000 flavor.disk = 1024 flavor.ram = 10000 self.flavors = (flavor, ) keypair = api.KeyPair(None) keypair.name = 'keyName' self.keypairs = (keypair, ) security_group = api.SecurityGroup(None) security_group.name = 'default' self.security_groups = (security_group, )