@@ -557,34 +557,3 @@ def test_workspace_configuration(self, workspace):
557557 with mock .patch ("openhexa.sdk.workspaces.current_workspace.OpenHexaClient" ) as mock_client :
558558 mock_client .return_value .workspace .return_value = mock_workspace_data
559559 assert workspace .configuration == mock_config
560-
561- def test_workspace_get_config (self , workspace ):
562- mock_config = {
563- "api_url" : "https://api.example.com" ,
564- "debug_mode" : "true" ,
565- "database_config" : {"host" : "localhost" , "port" : 5432 },
566- }
567-
568- mock_workspace_data = mock .Mock ()
569- mock_workspace_data .configuration = mock_config
570-
571- with mock .patch ("openhexa.sdk.workspaces.current_workspace.OpenHexaClient" ) as mock_client :
572- mock_client .return_value .workspace .return_value = mock_workspace_data
573-
574- assert workspace .get_config ("api_url" ) == "https://api.example.com"
575- assert workspace .get_config ("database_config" ) == {"host" : "localhost" , "port" : 5432 }
576- assert workspace .get_config ("missing_key" , "default_value" ) == "default_value"
577- assert workspace .get_config ("missing_key" ) is None
578-
579- def test_workspace_has_config (self , workspace ):
580- mock_config = {"api_url" : "https://api.example.com" , "debug_mode" : "true" }
581-
582- mock_workspace_data = mock .Mock ()
583- mock_workspace_data .configuration = mock_config
584-
585- with mock .patch ("openhexa.sdk.workspaces.current_workspace.OpenHexaClient" ) as mock_client :
586- mock_client .return_value .workspace .return_value = mock_workspace_data
587-
588- assert workspace .has_config ("api_url" ) is True
589- assert workspace .has_config ("debug_mode" ) is True
590- assert workspace .has_config ("missing_key" ) is False
0 commit comments