Add close connection, update tests.

This commit is contained in:
Pablo Martin 2023-01-20 15:53:45 +01:00
parent 1e0faf702f
commit a15b2f4a86
2 changed files with 15 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import trino
from lolafect.lolaconfig import build_lolaconfig
from lolafect.connections import connect_to_trino
from lolafect.connections import connect_to_trino, close_trino_connection
# This testing suite requires:
# - The calling shell to have permission in AWS
@ -9,10 +9,10 @@ from lolafect.connections import connect_to_trino
TEST_LOLACONFIG = build_lolaconfig(flow_name="testing-suite")
def test_that_trino_connector_works_properly():
def test_that_trino_connect_and_disconnect_works_properly():
connection = connect_to_trino.run(TEST_LOLACONFIG.TRINO_CREDENTIALS)
connection = connect_to_trino.run(trino_credentials=TEST_LOLACONFIG.TRINO_CREDENTIALS)
connection.cursor().execute("SELECT 1")
assert type(connection) == trino.dbapi.Connection
close_trino_connection.run(trino_connection=connection)