882 self.assertEqual(len(cnx.execute('Any X WHERE X test FALSE')), 0) |
882 self.assertEqual(len(cnx.execute('Any X WHERE X test FALSE')), 0) |
883 |
883 |
884 def test_select_constant(self): |
884 def test_select_constant(self): |
885 rset = self.qexecute('Any X, "toto" ORDERBY X WHERE X is CWGroup') |
885 rset = self.qexecute('Any X, "toto" ORDERBY X WHERE X is CWGroup') |
886 self.assertEqual(rset.rows, |
886 self.assertEqual(rset.rows, |
887 map(list, zip((2,3,4,5), ('toto','toto','toto','toto',)))) |
887 [list(x) for x in zip((2,3,4,5), ('toto','toto','toto','toto',))]) |
888 self.assertIsInstance(rset[0][1], text_type) |
888 self.assertIsInstance(rset[0][1], text_type) |
889 self.assertEqual(rset.description, |
889 self.assertEqual(rset.description, |
890 zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'), |
890 list(zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'), |
891 ('String', 'String', 'String', 'String',))) |
891 ('String', 'String', 'String', 'String',)))) |
892 rset = self.qexecute('Any X, %(value)s ORDERBY X WHERE X is CWGroup', {'value': 'toto'}) |
892 rset = self.qexecute('Any X, %(value)s ORDERBY X WHERE X is CWGroup', {'value': 'toto'}) |
893 self.assertEqual(rset.rows, |
893 self.assertEqual(rset.rows, |
894 map(list, zip((2,3,4,5), ('toto','toto','toto','toto',)))) |
894 list(map(list, zip((2,3,4,5), ('toto','toto','toto','toto',))))) |
895 self.assertIsInstance(rset[0][1], text_type) |
895 self.assertIsInstance(rset[0][1], text_type) |
896 self.assertEqual(rset.description, |
896 self.assertEqual(rset.description, |
897 zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'), |
897 list(zip(('CWGroup', 'CWGroup', 'CWGroup', 'CWGroup'), |
898 ('String', 'String', 'String', 'String',))) |
898 ('String', 'String', 'String', 'String',)))) |
899 rset = self.qexecute('Any X,GN WHERE X is CWUser, G is CWGroup, X login "syt", ' |
899 rset = self.qexecute('Any X,GN WHERE X is CWUser, G is CWGroup, X login "syt", ' |
900 'X in_group G, G name GN') |
900 'X in_group G, G name GN') |
901 |
901 |
902 def test_select_union(self): |
902 def test_select_union(self): |
903 rset = self.qexecute('Any X,N ORDERBY N WITH X,N BEING ' |
903 rset = self.qexecute('Any X,N ORDERBY N WITH X,N BEING ' |