Skip to content
Snippets Groups Projects
Commit 6e6addaf authored by Razvan Vass's avatar Razvan Vass
Browse files

One wrong dashboard upload test removed

parent 4201425f
1 merge request!11Adding Dashboards for Percolation and for the roofline dashboard
Pipeline #68819 failed with stages
in 1 minute and 19 seconds
......@@ -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')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment