From 2c9cddbd7593572a2ca7c4dcf6e6caffcc495f36 Mon Sep 17 00:00:00 2001 From: James Maslek Date: Tue, 21 Feb 2023 12:29:48 -0500 Subject: [PATCH] Change sources path (#4312) --- openbb_terminal/core/config/paths.py | 2 +- tests/openbb_terminal/test_sources.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/openbb_terminal/test_sources.py diff --git a/openbb_terminal/core/config/paths.py b/openbb_terminal/core/config/paths.py index 6cbf00611d0..e5b44b65cfe 100644 --- a/openbb_terminal/core/config/paths.py +++ b/openbb_terminal/core/config/paths.py @@ -27,7 +27,7 @@ USER_EXPORTS_DIRECTORY = USER_DATA_DIRECTORY / "exports" USER_CUSTOM_IMPORTS_DIRECTORY = USER_DATA_DIRECTORY / "custom_imports" USER_PORTFOLIO_DATA_DIRECTORY = USER_DATA_DIRECTORY / "portfolio" USER_ROUTINES_DIRECTORY = USER_DATA_DIRECTORY / "routines" -USER_DATA_SOURCES_DEFAULT_FILE = USER_DATA_DIRECTORY / "data_sources_default.json" +USER_DATA_SOURCES_DEFAULT_FILE = MISCELLANEOUS_DIRECTORY / "data_sources_default.json" USER_PRESETS_DIRECTORY = USER_DATA_DIRECTORY / "presets" USER_REPORTS_DIRECTORY = USER_DATA_DIRECTORY / "reports" USER_CUSTOM_REPORTS_DIRECTORY = USER_DATA_DIRECTORY / "reports" / "custom reports" diff --git a/tests/openbb_terminal/test_sources.py b/tests/openbb_terminal/test_sources.py new file mode 100644 index 00000000000..ee8142aebb7 --- /dev/null +++ b/tests/openbb_terminal/test_sources.py @@ -0,0 +1,10 @@ +import json + +from openbb_terminal.core.config.paths import USER_DATA_SOURCES_DEFAULT_FILE + + +def test_sources_load(): + with open(str(USER_DATA_SOURCES_DEFAULT_FILE)) as json_file: + json_doc = json.load(json_file) + assert isinstance(json_doc, dict) + assert "stocks" in json_doc