MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / test_to_sqlite3_query

Method test_to_sqlite3_query

functional/test/test_streams.py:415–425  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

413 self.assertListEqual(elements, result)
414
415 def test_to_sqlite3_query(self):
416 elements = [(1, "Tom"), (2, "Jack"), (3, "Jane"), (4, "Stephan")]
417
418 with sqlite3.connect(":memory:") as conn:
419 conn.execute("CREATE TABLE user (id INT, name TEXT);")
420 conn.commit()
421
422 insert_sql = "INSERT INTO user (id, name) VALUES (?, ?)"
423 self.seq(elements).to_sqlite3(conn, insert_sql)
424 result = self.seq.sqlite3(conn, "SELECT id, name FROM user;").to_list()
425 self.assertListEqual(elements, result)
426
427 def test_to_sqlite3_tuple(self):
428 elements = [(1, "Tom"), (2, "Jack"), (3, "Jane"), (4, "Stephan")]

Callers

nothing calls this directly

Calls 3

to_sqlite3Method · 0.80
to_listMethod · 0.80
sqlite3Method · 0.80

Tested by

no test coverage detected