Merge "Fix the test_flavor_show tempest test"
This commit is contained in:
commit
062ab16ce3
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from tempest.lib.common.utils import data_utils
|
|
||||||
from tempest.lib import decorators
|
from tempest.lib import decorators
|
||||||
from tempest.lib import exceptions as lib_exc
|
from tempest.lib import exceptions as lib_exc
|
||||||
|
|
||||||
@ -26,10 +25,10 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def resource_setup(cls):
|
def resource_setup(cls):
|
||||||
super(BaremetalComputeAPITest, cls).resource_setup()
|
super(BaremetalComputeAPITest, cls).resource_setup()
|
||||||
for i in six.moves.xrange(3):
|
for i in six.moves.xrange(2):
|
||||||
body = {"name": data_utils.rand_name('mogan_flavor'),
|
body = {"name": "mogan_flavor_" + {0: 'public', 1: 'private'}[i],
|
||||||
"description": "mogan flavor description",
|
"description": "mogan flavor description",
|
||||||
'is_public': bool(data_utils.rand_int_id(0, 1))}
|
'is_public': not bool(i)}
|
||||||
resp = cls.baremetal_compute_client.create_flavor(**body)
|
resp = cls.baremetal_compute_client.create_flavor(**body)
|
||||||
cls.flavor_ids.append(resp['uuid'])
|
cls.flavor_ids.append(resp['uuid'])
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest):
|
|||||||
@decorators.idempotent_id('ab1a5147-0e3e-4a29-8c28-505d29fac8dd')
|
@decorators.idempotent_id('ab1a5147-0e3e-4a29-8c28-505d29fac8dd')
|
||||||
def test_flavor_show(self):
|
def test_flavor_show(self):
|
||||||
resp = self.baremetal_compute_client.show_flavor(self.flavor_ids[0])
|
resp = self.baremetal_compute_client.show_flavor(self.flavor_ids[0])
|
||||||
self.assertIn('name', resp)
|
self.assertIn('mogan_flavor_public', resp['name'])
|
||||||
self.assertEqual('mogan flavor description',
|
self.assertEqual('mogan flavor description',
|
||||||
resp['description'])
|
resp['description'])
|
||||||
self.assertEqual(True, resp['is_public'])
|
self.assertEqual(True, resp['is_public'])
|
||||||
|
Loading…
Reference in New Issue
Block a user