From 05e6cb42d1fe953815a2a70c2a34254695500bf1 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 27 May 2024 16:32:35 +0200 Subject: [PATCH] store CI key secret in separate env --- tests/test_waybar_crypto.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_waybar_crypto.py b/tests/test_waybar_crypto.py index 2b9cb67..6347402 100644 --- a/tests/test_waybar_crypto.py +++ b/tests/test_waybar_crypto.py @@ -18,6 +18,8 @@ read_config, ) +TEST_API_KEY_ENV = "TEST_CMC_API_KEY" +API_KEY = os.getenv(TEST_API_KEY_ENV) TEST_CONFIG_PATH = "./config.ini.example" TEST_API_KEY = "test_key" @@ -244,6 +246,7 @@ def test_read_config_env(): class TestWaybarCrypto: """Tests for the WaybarCrypto.""" + @mock.patch.dict(os.environ, {API_KEY_ENV: API_KEY}) def test_get_coinmarketcap_latest(self, waybar_crypto: WaybarCrypto): resp_quotes_latest = waybar_crypto.coinmarketcap_latest() assert isinstance(resp_quotes_latest, dict)