Modify unit test case test_list_image_sorted
Currently test_list_image_sorted is using NameGenerator class to generate image name in loop. NameGenerator may generate duplicate names in the loop which may cause failure of the test case, this patch fixes that by giving predefined names instead of names generated at runtime. Closes-Bug: #1636117 Change-Id: I8d550aa74d587905e4ef4d3be21138e35aec0909
This commit is contained in:
@@ -70,9 +70,9 @@ class DbImageTestCase(base.DbTestCase):
|
||||
|
||||
def test_list_image_sorted(self):
|
||||
uuids = []
|
||||
for _ in range(5):
|
||||
for i in range(5):
|
||||
image = utils.create_test_image(
|
||||
uuid=uuidutils.generate_uuid())
|
||||
uuid=uuidutils.generate_uuid(), repo="testrepo" + str(i))
|
||||
uuids.append(six.text_type(image.uuid))
|
||||
res = self.dbapi.list_image(self.context, sort_key='uuid')
|
||||
res_uuids = [r.uuid for r in res]
|
||||
|
||||
Reference in New Issue
Block a user