From f35d192b5f4a35b30fdd5dfe21429f93f645c5ba Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Wed, 21 Nov 2012 17:33:04 -0700 Subject: object-storage: Add a sorted list comparison to test After the commit b0cb7aaf for bz#870589, which adds 2 tarballs with layout patterns, Swift tests sometimes fail (depending on the kind of filesystem they are running at and the phase of the moon). As pattern tarball is unpacked, the underlying filesystem is free to return directory listings in any order, and straightforward use of '==' operator fails. As it turns out, one of the two comparisons had set() applied to the list already. So, add it to the other one. BUG: 874390 Change-Id: I02de99593b9567a13076113d58e242b079fde002 Signed-off-by: Pete Zaitcev Reviewed-on: http://review.gluster.org/4165 Reviewed-by: Peter Portante Tested-by: Peter Portante --- ufo/test/unit/common/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ufo') diff --git a/ufo/test/unit/common/test_utils.py b/ufo/test/unit/common/test_utils.py index ec66324a..21acd8e9 100644 --- a/ufo/test/unit/common/test_utils.py +++ b/ufo/test/unit/common/test_utils.py @@ -784,10 +784,10 @@ class TestUtils(unittest.TestCase): cd = utils._get_container_details_from_fs(td) assert cd.bytes_used == 30, repr(cd.bytes_used) assert cd.object_count == 8, repr(cd.object_count) - assert cd.obj_list == ['file1', 'file3', 'file2', + assert set(cd.obj_list) == set(['file1', 'file3', 'file2', 'dir3', 'dir1', 'dir2', 'dir1/file1', 'dir1/file2' - ], repr(cd.obj_list) + ]), repr(cd.obj_list) full_dir1 = os.path.join(td, 'dir1') full_dir2 = os.path.join(td, 'dir2') full_dir3 = os.path.join(td, 'dir3') -- cgit