From 2e4e7bc0ef808f6e38a0f7e421c6b1f5b0269576 Mon Sep 17 00:00:00 2001 From: mohammadrezapourreza Date: Tue, 2 Apr 2024 10:45:53 -0400 Subject: [PATCH] modify the code for the tests --- dataherald/sql_database/models/types.py | 4 ++-- dataherald/tests/db/test_db.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dataherald/sql_database/models/types.py b/dataherald/sql_database/models/types.py index 05ecba5b..0254711a 100644 --- a/dataherald/sql_database/models/types.py +++ b/dataherald/sql_database/models/types.py @@ -121,8 +121,8 @@ def set_dialect(cls, input_string): def connection_uri_format(cls, value: str, values): fernet_encrypt = FernetEncrypt() try: - decrypted_value = fernet_encrypt.decrypt(value) - dialect_prefix = cls.validate_uri(decrypted_value) + decrypted_connection_uri = fernet_encrypt.decrypt(value) + dialect_prefix = cls.validate_uri(decrypted_connection_uri) except Exception: dialect_prefix = cls.validate_uri(value) value = fernet_encrypt.encrypt(value) diff --git a/dataherald/tests/db/test_db.py b/dataherald/tests/db/test_db.py index 26a32a70..4adc1189 100644 --- a/dataherald/tests/db/test_db.py +++ b/dataherald/tests/db/test_db.py @@ -15,6 +15,7 @@ def __init__(self, system: System): { "_id": ObjectId("64dfa0e103f5134086f7090c"), "alias": "alias", + "dialect": "dialect", "use_ssh": False, "connection_uri": "gAAAAABkwD9Y9EpBxF1hRxhovjvedX1TeDNu-WaGqDebk_CJnpGjRlpXzDOl_puehMSbz9KDQ6OqPepl8XQpD0EchiV7he4j5tEXYE33eak87iORA7s8ko0=", # noqa: E501 "ssh_settings": None,