[tracker/wip/carlosg/fix-cursor-string-length: 2/2] tests: Test that we get all expected rows and columns in portal




commit 439e08f3d188896f391f2afb6086bcad1cd99679
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Dec 26 14:01:13 2020 +0100

    tests: Test that we get all expected rows and columns in portal
    
    This would catch the situation at
    https://gitlab.gnome.org/GNOME/tracker/-/issues/282, if reverting
    the previous commit.

 tests/functional-tests/portal.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/tests/functional-tests/portal.py b/tests/functional-tests/portal.py
index a4e82820f..194f4e86b 100644
--- a/tests/functional-tests/portal.py
+++ b/tests/functional-tests/portal.py
@@ -57,6 +57,21 @@ class TestPortal(fixtures.TrackerPortalTest):
         self.assertEqual(len(res), 1)
         self.assertEqual(res[0][0], 'b')
 
+    def test_04_rows_cols(self):
+        self.start_service('org.freedesktop.PortalTest')
+        res = self.query(
+            'org.freedesktop.PortalTest',
+            'select ?a ?b { VALUES (?a ?b) { (1 2) (3 4) (5 6) } }')
+        self.assertEqual(len(res), 3)
+        self.assertEqual(res[0][0], '1')
+        self.assertEqual(res[0][1], '2')
+        self.assertEqual(len(res[0]), 2)
+        self.assertEqual(res[1][0], '3')
+        self.assertEqual(res[1][1], '4')
+        self.assertEqual(len(res[1]), 2)
+        self.assertEqual(res[2][0], '5')
+        self.assertEqual(res[2][1], '6')
+        self.assertEqual(len(res[2]), 2)
 
 if __name__ == '__main__':
     fixtures.tracker_test_main()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]