summaryrefslogtreecommitdiffstats
path: root/ufo/test/unit/common/test_utils.py
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@kotori.zaitcev.us>2012-11-21 17:33:04 -0700
committerPeter Portante <peter.portante@redhat.com>2013-04-29 16:35:56 -0400
commit57ebd5ae177614ac18308965328a6a75f66ac7e8 (patch)
treec22fd209ab4b40a727bb1e9b1fd76f5e60e02214 /ufo/test/unit/common/test_utils.py
parentb0258bcd0ff34109b6178b45bdedc6505ede10e7 (diff)
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 <zaitcev@redhat.com> Reviewed-on: http://review.gluster.org/4165 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'ufo/test/unit/common/test_utils.py')
-rw-r--r--ufo/test/unit/common/test_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ufo/test/unit/common/test_utils.py b/ufo/test/unit/common/test_utils.py
index ec66324..21acd8e 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')