kopia lustrzana https://github.com/micropython/micropython-lib
sqlite3: test_sqlite3: Turn into a real test (with asserts).
rodzic
d113ea4751
commit
5cb3fe10f0
|
@ -4,9 +4,16 @@ import sqlite3
|
||||||
conn = sqlite3.connect(":memory:")
|
conn = sqlite3.connect(":memory:")
|
||||||
|
|
||||||
cur = conn.cursor()
|
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:
|
while True:
|
||||||
row = cur.fetchone()
|
row = cur.fetchone()
|
||||||
if row is None:
|
if row is None:
|
||||||
break
|
break
|
||||||
print(row)
|
print(row)
|
||||||
|
e = expected.pop(0)
|
||||||
|
assert row == e
|
||||||
|
|
||||||
|
assert expected == []
|
||||||
|
|
Ładowanie…
Reference in New Issue