@@ -906,13 +906,14 @@ def test_get_auto_detect(self, mock_control_api_class):
906906 mock_control_api_class .return_value = mock_control_api
907907
908908 mock_result = MagicMock ()
909- mock_control_api .get_model_proxy .return_value = mock_result
909+ mock_control_api .get_model_service .return_value = mock_result
910910
911911 client = ModelClient ()
912912 result = client .get ("test" )
913913
914- # Should try proxy first
915- mock_control_api .get_model_proxy .assert_called_once ()
914+ # Should try service first (ModelService is the primary resource after migration)
915+ mock_control_api .get_model_service .assert_called_once ()
916+ mock_control_api .get_model_proxy .assert_not_called ()
916917
917918 @patch .dict (
918919 os .environ ,
@@ -923,27 +924,25 @@ def test_get_auto_detect(self, mock_control_api_class):
923924 },
924925 )
925926 @patch ("agentrun.model.client.ModelControlAPI" )
926- def test_get_auto_detect_falls_back_to_service (
927- self , mock_control_api_class
928- ):
929- """Test fallback to service when proxy not found"""
927+ def test_get_auto_detect_falls_back_to_proxy (self , mock_control_api_class ):
928+ """Test fallback to proxy when service not found"""
930929 mock_control_api = MagicMock ()
931930 mock_control_api_class .return_value = mock_control_api
932931
933- # Proxy get fails
934- mock_control_api .get_model_proxy .side_effect = HTTPError (
932+ # Service get fails
933+ mock_control_api .get_model_service .side_effect = HTTPError (
935934 status_code = 404 , message = "Not found"
936935 )
937- # Service get succeeds
936+ # Proxy get succeeds
938937 mock_result = MagicMock ()
939- mock_control_api .get_model_service .return_value = mock_result
938+ mock_control_api .get_model_proxy .return_value = mock_result
940939
941940 client = ModelClient ()
942941 result = client .get ("test" )
943942
944- mock_control_api .get_model_proxy .assert_called_once ()
945943 mock_control_api .get_model_service .assert_called_once ()
946- assert isinstance (result , ModelService )
944+ mock_control_api .get_model_proxy .assert_called_once ()
945+ assert isinstance (result , ModelProxy )
947946
948947 @patch .dict (
949948 os .environ ,
@@ -1009,26 +1008,26 @@ async def test_get_async_service(self, mock_control_api_class):
10091008 @patch ("agentrun.model.client.ModelControlAPI" )
10101009 @pytest .mark .asyncio
10111010 async def test_get_async_auto_detect_fallback (self , mock_control_api_class ):
1012- """Test fallback to service when proxy not found in async get"""
1011+ """Test fallback to proxy when service not found in async get"""
10131012 mock_control_api = MagicMock ()
10141013 mock_control_api_class .return_value = mock_control_api
10151014
1016- # Proxy get fails
1017- mock_control_api .get_model_proxy_async = AsyncMock (
1015+ # Service get fails
1016+ mock_control_api .get_model_service_async = AsyncMock (
10181017 side_effect = HTTPError (status_code = 404 , message = "Not found" )
10191018 )
1020- # Service get succeeds
1019+ # Proxy get succeeds
10211020 mock_result = MagicMock ()
1022- mock_control_api .get_model_service_async = AsyncMock (
1021+ mock_control_api .get_model_proxy_async = AsyncMock (
10231022 return_value = mock_result
10241023 )
10251024
10261025 client = ModelClient ()
10271026 result = await client .get_async ("test" )
10281027
1029- mock_control_api .get_model_proxy_async .assert_called_once ()
10301028 mock_control_api .get_model_service_async .assert_called_once ()
1031- assert isinstance (result , ModelService )
1029+ mock_control_api .get_model_proxy_async .assert_called_once ()
1030+ assert isinstance (result , ModelProxy )
10321031
10331032 @patch .dict (
10341033 os .environ ,
0 commit comments