Skip to content
Permalink
Browse files

Update tests for java-style iteraror

  • Loading branch information
elpaso committed Dec 23, 2020
1 parent d5b6590 commit 303f689b7bb111967f7bc3ed6cf343d6a244b596
Showing with 12 additions and 1 deletion.
  1. +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

0 comments on commit 303f689

Please sign in to comment.
You can’t perform that action at this time.