From 756fd24514fbfb53ac41a5063dbef5efe1033ea9 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Singh Date: Mon, 24 Oct 2016 09:18:22 +0000 Subject: [PATCH] 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 --- zun/tests/unit/db/test_image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zun/tests/unit/db/test_image.py b/zun/tests/unit/db/test_image.py index 2d6cc4d4e..f24ad687f 100644 --- a/zun/tests/unit/db/test_image.py +++ b/zun/tests/unit/db/test_image.py @@ -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]