sqlite3: test_sqlite3: Turn into a real test (with asserts).

pull/121/merge
Paul Sokolovsky 2017-08-30 00:05:07 +03:00
rodzic d113ea4751
commit 5cb3fe10f0
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -4,9 +4,16 @@ import sqlite3
conn = sqlite3.connect(":memory:")
cur = conn.cursor()
cur.execute("SELECT 1, 'foo', 3.14159 UNION SELECT 3, 3, 3")
cur.execute("SELECT 1, 'foo', 3.0 UNION SELECT 3, 3, 3")
expected = [(1, 'foo', 3.0), (3, 3, 3)]
while True:
row = cur.fetchone()
if row is None:
break
print(row)
e = expected.pop(0)
assert row == e
assert expected == []