File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 22# We need to ignore syntax errors until https://github.com/python/mypy/issues/17535 is resolved.
33from typing import Any , Optional
44
5+ from pydantic_core import Url
6+
57from galileo_core .schemas .base_config import GalileoConfig
68
79
810class GalileoPythonConfig (GalileoConfig ):
911 # Config file for this project.
1012 config_filename : str = "galileo-python-config.json"
13+ console_url : Url = "https://app.galileo.ai"
1114
1215 def reset (self ) -> None :
1316 global _galileo_config
Original file line number Diff line number Diff line change 1+ from unittest .mock import patch
2+
3+ from galileo .config import GalileoPythonConfig
4+
5+
6+ @patch ("galileo_core.schemas.base_config.GalileoConfig.set_validated_api_client" , new = lambda x : x )
7+ @patch ("galileo_core.schemas.base_config.GalileoConfig.get_jwt_token" )
8+ def test_default_console_url (mock_get_jwt_token ):
9+ """
10+ Test that the default console_url is used when GALILEO_CONSOLE_URL is not set.
11+ """
12+ mock_get_jwt_token .return_value = ("mock_jwt_token" , "mock_refresh_token" )
13+
14+ # Unset the environment variable to ensure we test the default
15+ with patch .dict ("os.environ" , {}, clear = True ):
16+ # Reset the global config object to force re-initialization
17+ GalileoPythonConfig .get ().reset ()
18+ config = GalileoPythonConfig .get (api_key = "mock_api_key" )
19+
20+ assert str (config .console_url ) == "https://app.galileo.ai/"
21+ assert str (config .api_url ) == "https://api.galileo.ai/"
You can’t perform that action at this time.
0 commit comments