]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Care less about ordering when checking grants 186/head
authorTim Burke <tim.burke@gmail.com>
Tue, 12 Sep 2017 18:42:35 +0000 (12:42 -0600)
committerTim Burke <tim.burke@gmail.com>
Tue, 12 Sep 2017 19:24:00 +0000 (13:24 -0600)
Some tests, like test_object_header_acl_grants and
test_bucket_header_acl_grants, use the same id for all permissions.
Sort() is stable, so those tests end up testing the order of acl grants
returned by Boto. Not sure, but I think this may in turn depend on the
order of HTTP headers, where the order is not significant.

Signed-off-by: Tim Burke <tim.burke@gmail.com>
s3tests/functional/test_s3.py

index dd943ffa9a6dac828ffa44603693020c04551abe..511ec420a5612c0f1d642e32c0767cdca2f7dfcd 100644 (file)
@@ -81,8 +81,8 @@ def check_grants(got, want):
     in any order.
     """
     eq(len(got), len(want))
-    got = sorted(got, key=operator.attrgetter('id'))
-    want = sorted(want, key=operator.itemgetter('id'))
+    got = sorted(got, key=operator.attrgetter('id', 'permission'))
+    want = sorted(want, key=operator.itemgetter('id', 'permission'))
     for g, w in zip(got, want):
         w = dict(w)
         eq(g.permission, w.pop('permission'))