diff --git a/model/test_discordUtils.py b/model/test_discordUtils.py index a4a7fd9..d2b5acb 100644 --- a/model/test_discordUtils.py +++ b/model/test_discordUtils.py @@ -8,7 +8,7 @@ import responses -PATH_OF_THIS_FILE = os.path.dirname(os.path.abspath(__file__)) +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) @pytest.fixture(scope='module') @@ -17,7 +17,7 @@ def cfg(): cfg_file = cu.find_config() except FileNotFoundError as e: print(e) - cfg_file = os.path.join(PATH_OF_THIS_FILE, "../example_reddit.cfg") + cfg_file = os.path.join(THIS_DIR, "../example_reddit.cfg") cfg = cu.parse_config(cfg_file) return cfg diff --git a/model/test_model.py b/model/test_model.py index c9d8699..2843c00 100644 --- a/model/test_model.py +++ b/model/test_model.py @@ -99,13 +99,13 @@ def modelName(): @pytest.fixture(scope='module') def cfg(): - try: - cfg_file = cu.find_config() - except FileNotFoundError as e: - print(e) - cfg_file = os.path.join(PATH_OF_THIS_FILE, "../example_reddit.cfg") - cfg = cu.parse_config(cfg_file) - return cfg + try: + cfg_file = cu.find_config() + except FileNotFoundError as e: + print(e) + cfg_file = os.path.join(THIS_DIR, "../example_reddit.cfg") + cfg = cu.parse_config(cfg_file) + return cfg # need to find a way to mock this, couldn't find anything that does that diff --git a/model/test_modelUtils.py b/model/test_modelUtils.py index 3ffb75b..2ed18f1 100644 --- a/model/test_modelUtils.py +++ b/model/test_modelUtils.py @@ -4,6 +4,8 @@ from moto import mock_s3 import pytest import os + + THIS_DIR = os.path.dirname(os.path.abspath(__file__))