diff --git a/tests/test_dashboard_upload.py b/tests/test_dashboard_upload.py index bcd316b7f9e8ca3dfb983509bf07986532154498..4db6e7d9024ad6486e775844f363e7be299eae07 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')