mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-23 09:26:30 +00:00
* Remove CircleCI-specific path in tests * ..? * Fix testsP * Fix python test * remove pip * Maybe fail? * return code? * no & * Fix tests
23 lines
595 B
Python
23 lines
595 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://admin_user:admin_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()
|