From 807e5322986bf9907cc7badfbbb5c4866353079c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 23 Apr 2024 16:31:39 +0300 Subject: tests: Add missing configs to allow tests to run. --- tests/unit/conftest.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 2230f7a..dd94899 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,4 +1,5 @@ """Fixtures for unit tests.""" +import os from pathlib import Path from datetime import datetime from tempfile import TemporaryDirectory @@ -14,10 +15,15 @@ def fxtr_app(): with TemporaryDirectory() as testdir: testdb = Path(testdir).joinpath( f'testdb_{datetime.now().strftime("%Y%m%dT%H%M%S")}') + testuploadsdir = Path(testdir).joinpath("uploads") + testuploadsdir.mkdir() app = create_app({ - "TESTING": True, "AUTH_DB": testdb, + "TESTING": True, + "AUTH_DB": testdb, "OAUTH2_ACCESS_TOKEN_GENERATOR": "tests.unit.auth.test_token.gen_token", - "SECRET_KEY": "qQIrgiK29kXZU6v8D09y4uw_sk8I4cqgNZniYUrRoUk" + "SECRET_KEY": "qQIrgiK29kXZU6v8D09y4uw_sk8I4cqgNZniYUrRoUk", + "UPLOADS_DIR": testuploadsdir, + "SSL_PRIVATE_KEY": f"{os.path.dirname(__file__)}/test-ssl-private-key.pem" }) app.testing = True yield app -- cgit v1.2.3