summaryrefslogtreecommitdiffstats
path: root/ufo
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@kotori.zaitcev.us>2012-11-21 17:33:04 -0700
committerAnand Avati <avati@redhat.com>2012-11-21 18:27:29 -0800
commitf35d192b5f4a35b30fdd5dfe21429f93f645c5ba (patch)
treed9906b1bd52ab2e0d9bcc81795e36b57d0cb2a15 /ufo
parent1f64e5e3dd7f871e112ad9d3e9fae3cc5e15fd88 (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')
-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 ec66324a052..21acd8e90f5 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')