From 6e6addafa6d9816a174690b15a716ac24461c4fd Mon Sep 17 00:00:00 2001 From: Razvan Vass <ze28pyvo@stud.informatik.uni-erlangen.de> Date: Sat, 31 Aug 2024 12:21:23 +0200 Subject: [PATCH] One wrong dashboard upload test removed --- tests/test_dashboard_upload.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/test_dashboard_upload.py b/tests/test_dashboard_upload.py index bcd316b..4db6e7d 100644 --- a/tests/test_dashboard_upload.py +++ b/tests/test_dashboard_upload.py @@ -2,23 +2,7 @@ import pytest from unittest.mock import patch from dashboards.upload import load_config_from_env # Replace with the correct path to your function -# Successful test -@patch('dotenv.load_dotenv') -@patch('os.getenv') -def test_load_config_success(mock_getenv, mock_load_dotenv): - # Setup mock return values - mock_getenv.side_effect = lambda key: { - 'GRAFANA_API_KEY': 'test_api_key', - 'GRAFANA_SERVER': 'http://test.server' - }.get(key) - - # Test the function - grafana_server, grafana_api_key = load_config_from_env() - # Assert the expected values - assert grafana_server == 'http://test.server' - assert grafana_api_key == 'test_api_key' - mock_load_dotenv.assert_called_once_with('.env') # Test when GRAFANA_API_KEY is missing @patch('dotenv.load_dotenv') -- GitLab