@@ -110,7 +110,7 @@ def test__generate_request_handler(self): #
110110
111111 assert code == AUTO_GEN__CODE__GENERATE_REQUEST_HANDLER
112112
113- assert "class Enum__Client__Mode (str, Enum):" in code
113+ assert "class Enum__Fast_API__Service__Registry__Client__Mode (str, Enum):" in code
114114 assert "REMOTE = \" remote\" " in code
115115 assert "IN_MEMORY = \" in_memory\" " in code
116116 assert "LOCAL_SERVER = \" local_server\" " in code
@@ -513,7 +513,7 @@ def _create_test_contract(): #
513513import requests
514514from osbot_utils.type_safe.Type_Safe import Type_Safe
515515
516- class Enum__Client__Mode (str, Enum):
516+ class Enum__Fast_API__Service__Registry__Client__Mode (str, Enum):
517517 REMOTE = "remote" # HTTP calls to deployed service
518518 IN_MEMORY = "in_memory" # FastAPI TestClient (same process)
519519 LOCAL_SERVER = "local_server" # Fast_API_Server (local HTTP)
@@ -528,7 +528,7 @@ class TestService__Client__Requests__Result(Type_Safe):
528528
529529class TestService__Client__Requests(Type_Safe):
530530 config : Any # TestService__Client__Config
531- mode : Enum__Client__Mode = Enum__Client__Mode .REMOTE
531+ mode : Enum__Fast_API__Service__Registry__Client__Mode = Enum__Fast_API__Service__Registry__Client__Mode .REMOTE
532532 _app : Optional[Any] = None # FastAPI app for in-memory
533533 _server : Optional[Any] = None # Fast_API_Server for local
534534 _test_client : Optional[Any] = None # TestClient for in-memory
@@ -541,19 +541,19 @@ def __init__(self, **kwargs):
541541 def _setup_mode(self): # Initialize the appropriate execution backend
542542
543543 if self._app: # In-memory mode with TestClient
544- self.mode = Enum__Client__Mode .IN_MEMORY
544+ self.mode = Enum__Fast_API__Service__Registry__Client__Mode .IN_MEMORY
545545 from fastapi.testclient import TestClient
546546 self._test_client = TestClient(self._app)
547547
548548 elif self._server: # Local server mode
549- self.mode = Enum__Client__Mode .LOCAL_SERVER
549+ self.mode = Enum__Fast_API__Service__Registry__Client__Mode .LOCAL_SERVER
550550 from osbot_fast_api.utils.Fast_API_Server import Fast_API_Server
551551 if not isinstance(self._server, Fast_API_Server):
552552 self._server = Fast_API_Server(app=self._server)
553553 self._server.start()
554554
555555 else: # Remote mode
556- self.mode = Enum__Client__Mode .REMOTE
556+ self.mode = Enum__Fast_API__Service__Registry__Client__Mode .REMOTE
557557 self._session = requests.Session()
558558 self._configure_session()
559559
@@ -570,9 +570,9 @@ def execute(self, method : str , #
570570 # Merge headers
571571 request_headers = {**self.auth_headers(), **(headers or {})}
572572 # Execute based on mode
573- if self.mode == Enum__Client__Mode .IN_MEMORY:
573+ if self.mode == Enum__Fast_API__Service__Registry__Client__Mode .IN_MEMORY:
574574 response = self._execute_in_memory(method, path, body, request_headers)
575- elif self.mode == Enum__Client__Mode .LOCAL_SERVER:
575+ elif self.mode == Enum__Fast_API__Service__Registry__Client__Mode .LOCAL_SERVER:
576576 response = self._execute_local_server(method, path, body, request_headers)
577577 else:
578578 response = self._execute_remote(method, path, body, request_headers)
0 commit comments