[devtools] more sorted() vs dict vs python3
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 19 Oct 2015 18:08:34 +0200
changeset 10821 107b87bbbaa7
parent 10820 fef0ab4c4f94
child 10822 9337c72ad92c
[devtools] more sorted() vs dict vs python3
devtools/repotest.py
--- a/devtools/repotest.py	Tue Nov 03 12:25:14 2015 +0100
+++ b/devtools/repotest.py	Mon Oct 19 18:08:34 2015 +0200
@@ -57,7 +57,7 @@
                               'expected %s queries, got %s' % (len(equeries), len(queries)))
             for i, (rql, sol) in enumerate(queries):
                 self.assertEqual(rql, equeries[i][0])
-                self.assertEqual(sorted(sol), sorted(equeries[i][1]))
+                self.assertEqual(sorted(sorted(x.items()) for x in sol), sorted(sorted(x.items()) for x in equeries[i][1]))
             idx = 2
         else:
             idx = 1
@@ -317,7 +317,7 @@
 
 def _check_permissions(*args, **kwargs):
     res, restricted = _orig_check_permissions(*args, **kwargs)
-    res = DumbOrderedDict(sorted(res.items(), key=lambda x: x[1]))
+    res = DumbOrderedDict(sorted(res.items(), key=lambda x: [y.items() for y in x[1]]))
     return res, restricted
 
 def _dummy_check_permissions(self, rqlst):