From bef2694cedf5bcf64d32eb97e929ba6adb502234 Mon Sep 17 00:00:00 2001 From: Ross <9055337+chadsr@users.noreply.github.com> Date: Mon, 27 May 2024 17:37:43 +0200 Subject: [PATCH] test: fix loading of env api key secret (#83) --- tests/test_waybar_crypto.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_waybar_crypto.py b/tests/test_waybar_crypto.py index 544702a..a0c1e7e 100644 --- a/tests/test_waybar_crypto.py +++ b/tests/test_waybar_crypto.py @@ -28,7 +28,6 @@ if API_KEY is None: LOGGER.warning("No test API key provided. Skipping API tests") - TEST_CONFIG_PATH = "./config.ini.example" TEST_API_KEY = "test_key" @@ -258,7 +257,9 @@ class TestWaybarCrypto: API_KEY is None, reason=f"test API key not provided in '{TEST_API_KEY_ENV}'" ) @mock.patch.dict(os.environ, {API_KEY_ENV: API_KEY}) - def test_get_coinmarketcap_latest(self, waybar_crypto: WaybarCrypto): + def test_get_coinmarketcap_latest(self): + config = read_config(TEST_CONFIG_PATH) + waybar_crypto = WaybarCrypto(config) resp_quotes_latest = waybar_crypto.coinmarketcap_latest() assert isinstance(resp_quotes_latest, dict)