Skip to content

Commit 7c3cdde

Browse files
committed
Test connect properties
1 parent b5945e1 commit 7c3cdde

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tests/test_conn_cursor.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from chdb import connect
77

8-
enable_print = False
98
db_path = "test_db_3fdds"
109

1110

@@ -271,6 +270,23 @@ def test_multiple_connections(self):
271270
conn1.close()
272271
conn2.close()
273272

273+
def test_connection_properties(self):
274+
# conn = connect("{db_path}?log_queries=1&verbose=1&log-level=test")
275+
with self.assertRaises(Exception):
276+
conn = connect(f"{db_path}?not_exist_flag=1")
277+
with self.assertRaises(Exception):
278+
conn = connect(f"{db_path}?verbose=1")
279+
280+
conn = connect(f"{db_path}?verbose&log-level=test")
281+
ret = conn.query("SELECT 123", "CSV")
282+
print(ret)
283+
print(len(ret))
284+
self.assertEqual(str(ret), "123\n")
285+
ret = conn.query("show tables in system", "CSV")
286+
self.assertGreater(len(ret), 10)
287+
288+
conn.close()
289+
274290

275291
if __name__ == "__main__":
276292
unittest.main()

0 commit comments

Comments
 (0)