Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Update tests for java-style iteraror
- Loading branch information
Showing
with
12 additions
and
1 deletion.
-
+12
−1
tests/src/python/test_qgsproviderconnection_base.py
|
@@ -241,12 +241,23 @@ def _test_operations(self, md, conn): |
|
|
res = conn.execSql(sql) |
|
|
rows = [] |
|
|
self.assertTrue(res.hasNextRow()) |
|
|
|
|
|
for row in res: |
|
|
rows.append(row) |
|
|
|
|
|
self.assertEqual(rows, old_rows) |
|
|
self.assertEqual(rows, res.rows()) |
|
|
|
|
|
# Java style |
|
|
res = conn.execSql(sql) |
|
|
rows = [] |
|
|
self.assertTrue(res.hasNextRow()) |
|
|
while res.hasNextRow(): |
|
|
rows.append(res.nextRow()) |
|
|
|
|
|
self.assertFalse(res.hasNextRow()) |
|
|
|
|
|
self.assertEqual(rows, old_rows) |
|
|
# But we still have access to rows: |
|
|
self.assertEqual(rows, res.rows()) |
|
|
|
|
|
sql = "SELECT time_t FROM %s" % table |
|
|