Add tests for trino feature

This commit is contained in:
Pablo Martin 2023-03-29 17:18:00 +02:00
parent c3507cccec
commit b51c810a39

View file

@ -1,7 +1,7 @@
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from lolafect.lolaconfig import build_lolaconfig
from lolafect.data_testing import run_data_test_on_mysql
from lolafect.data_testing import run_data_test_on_mysql, run_data_test_on_trino
from lolafect.connections import open_ssh_tunnel_with_s3_pkey, close_ssh_tunnel
# __ __ _____ _ _ _____ _ _ _____ _
@ -110,3 +110,41 @@ def test_validation_on_mysql_fails():
data_test_failed = validation_result["success"] == False
assert data_test_failed
def test_validation_on_trino_succeeds():
validation_result = run_data_test_on_trino.run(
name="lolafect-testing-test_validation_on_mysql_fails",
trino_credentials={
"host": TEST_LOLACONFIG.TRINO_CREDENTIALS["host"],
"port": TEST_LOLACONFIG.TRINO_CREDENTIALS["port"],
"user": TEST_LOLACONFIG.TRINO_CREDENTIALS["user"],
"password": TEST_LOLACONFIG.TRINO_CREDENTIALS["password"],
"db": TEST_LOLACONFIG.TRINO_CREDENTIALS["default_db"],
},
query=TEST_QUERY,
expectation_configurations=TEST_EXPECTATIONS_THAT_FIT_DATA,
)
data_test_passed = validation_result["success"] == True
assert data_test_passed
def test_validation_on_trino_fails():
validation_result = run_data_test_on_trino.run(
name="lolafect-testing-test_validation_on_mysql_fails",
trino_credentials={
"host": TEST_LOLACONFIG.TRINO_CREDENTIALS["host"],
"port": TEST_LOLACONFIG.TRINO_CREDENTIALS["port"],
"user": TEST_LOLACONFIG.TRINO_CREDENTIALS["user"],
"password": TEST_LOLACONFIG.TRINO_CREDENTIALS["password"],
"db": TEST_LOLACONFIG.TRINO_CREDENTIALS["default_db"],
},
query=TEST_QUERY,
expectation_configurations=TEST_EXPECTATIONS_THAT_DONT_FIT_DATA,
)
data_test_failed = validation_result["success"] == False
assert data_test_failed