From 410ae12f8e059454b115c536666cc724eb3043a3 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 27 Jan 2025 13:16:55 +0100 Subject: [PATCH] feat: added ssl option to test database --- creyPY/fastapi/testing_unit.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/creyPY/fastapi/testing_unit.py b/creyPY/fastapi/testing_unit.py index cbde71d..0ef59be 100644 --- a/creyPY/fastapi/testing_unit.py +++ b/creyPY/fastapi/testing_unit.py @@ -24,13 +24,18 @@ class AbstractTestAPI(unittest.IsolatedAsyncioTestCase): @classmethod def setup_database( - cls, sync_db_url: str, async_db_url: str, base: Type[Base], btree_gist: bool = False + cls, + sync_db_url: str, + async_db_url: str, + base: Type[Base], + btree_gist: bool = False, + ssl_mode: str = "require", ): cls.engine_s = create_engine( sync_db_url, echo=False, pool_pre_ping=True, - connect_args={"sslmode": "require"}, + connect_args={"sslmode": ssl_mode}, ) if database_exists(cls.engine_s.url): drop_database(cls.engine_s.url)