Files
pgcat/tests/python/tests.py
Mostafa Abdelraouf 1b648ca00e Send proper server parameters to clients using admin db (#103)
* Send proper server parameters to clients using admin db

* clean up

* fix python test

* build

* Add python

* missing &

* debug ls

* fix tests

* fix tests

* fix

* Fix warning

* Address comments
2022-07-31 19:52:23 -07:00

23 lines
583 B
Python

import psycopg2
def test_normal_db_access():
conn = psycopg2.connect("postgres://sharding_user:sharding_user@127.0.0.1:6432/sharded_db?application_name=testing_pgcat")
cur = conn.cursor()
cur.execute("SELECT 1")
res = cur.fetchall()
print(res)
def test_admin_db_access():
conn = psycopg2.connect("postgres://user:pass@127.0.0.1:6432/pgcat")
conn.autocommit = True # BEGIN/COMMIT is not supported by admin db
cur = conn.cursor()
cur.execute("SHOW POOLS")
res = cur.fetchall()
print(res)
test_normal_db_access()
test_admin_db_access()