Merge "Fix the test_flavor_show tempest test"

This commit is contained in:
Jenkins 2017-06-07 06:47:27 +00:00 committed by Gerrit Code Review
commit 062ab16ce3

View File

@ -14,7 +14,6 @@
import six
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
@ -26,10 +25,10 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest):
@classmethod
def resource_setup(cls):
super(BaremetalComputeAPITest, cls).resource_setup()
for i in six.moves.xrange(3):
body = {"name": data_utils.rand_name('mogan_flavor'),
for i in six.moves.xrange(2):
body = {"name": "mogan_flavor_" + {0: 'public', 1: 'private'}[i],
"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)
cls.flavor_ids.append(resp['uuid'])
@ -65,7 +64,7 @@ class BaremetalComputeAPITest(base.BaseBaremetalComputeTest):
@decorators.idempotent_id('ab1a5147-0e3e-4a29-8c28-505d29fac8dd')
def test_flavor_show(self):
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',
resp['description'])
self.assertEqual(True, resp['is_public'])