[server/test] list() around map and zip
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 02 Oct 2015 10:08:00 +0200
changeset 10764 aa3a7bd5f651
parent 10763 5f9527b21bc0
child 10765 bd2e3c1d1fed
[server/test] list() around map and zip
server/test/unittest_querier.py
--- a/server/test/unittest_querier.py	Fri Oct 02 10:07:32 2015 +0200
+++ b/server/test/unittest_querier.py	Fri Oct 02 10:08:00 2015 +0200
@@ -884,18 +884,18 @@
     def test_select_constant(self):
         rset = self.qexecute('Any X, "toto" ORDERBY X WHERE X is CWGroup')
         self.assertEqual(rset.rows,
-                          map(list, zip((2,3,4,5), ('toto','toto','toto','toto',))))
+                         [list(x) for x in zip((2,3,4,5), ('toto','toto','toto','toto',))])
         self.assertIsInstance(rset[0][1], text_type)
         self.assertEqual(rset.description,
-                          zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'),
-                              ('String', 'String', 'String', 'String',)))
+                         list(zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'),
+                                  ('String', 'String', 'String', 'String',))))
         rset = self.qexecute('Any X, %(value)s ORDERBY X WHERE X is CWGroup', {'value': 'toto'})
         self.assertEqual(rset.rows,
-                          map(list, zip((2,3,4,5), ('toto','toto','toto','toto',))))
+                         list(map(list, zip((2,3,4,5), ('toto','toto','toto','toto',)))))
         self.assertIsInstance(rset[0][1], text_type)
         self.assertEqual(rset.description,
-                          zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'),
-                              ('String', 'String', 'String', 'String',)))
+                         list(zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'),
+                                  ('String', 'String', 'String', 'String',))))
         rset = self.qexecute('Any X,GN WHERE X is CWUser, G is CWGroup, X login "syt", '
                              'X in_group G, G name GN')