Set up test fixtures
(self)
| 26 | """Test cases for EngineClient.abort method""" |
| 27 | |
| 28 | def setUp(self): |
| 29 | """Set up test fixtures""" |
| 30 | self.loop = asyncio.new_event_loop() |
| 31 | asyncio.set_event_loop(self.loop) |
| 32 | |
| 33 | # Create a mock FDConfig |
| 34 | self.mock_fd_config = MagicMock() |
| 35 | self.mock_fd_config.parallel_config.tensor_parallel_size = 1 |
| 36 | self.mock_fd_config.model_config.enable_mm = False |
| 37 | self.mock_fd_config.model_config.max_model_len = 2048 |
| 38 | self.mock_fd_config.model_config.enable_logprob = True |
| 39 | self.mock_fd_config.cache_config.enable_prefix_caching = False |
| 40 | self.mock_fd_config.scheduler_config.splitwise_role = "mixed" |
| 41 | self.mock_fd_config.limit_mm_per_prompt = 5 |
| 42 | self.mock_fd_config.eplb_config.enable_eplb = False |
| 43 | self.mock_fd_config.structured_outputs_config.reasoning_parser = None |
| 44 | self.mock_fd_config.mm_processor_kwargs = {} |
| 45 | self.mock_fd_config.tool_parser = None |
| 46 | self.mock_fd_config.cache_config.max_processor_cache = 0 |
| 47 | |
| 48 | # Create EngineClient instance |
| 49 | with patch("fastdeploy.entrypoints.engine_client.InputPreprocessor"): |
| 50 | with patch("fastdeploy.entrypoints.engine_client.IPCSignal"): |
| 51 | with patch("fastdeploy.entrypoints.engine_client.StatefulSemaphore"): |
| 52 | with patch("fastdeploy.entrypoints.engine_client.DealerConnectionManager"): |
| 53 | with patch("fastdeploy.entrypoints.engine_client.FileLock"): |
| 54 | self.engine_client = EngineClient( |
| 55 | pid=12345, port=8000, fd_config=self.mock_fd_config, workers=1 |
| 56 | ) |
| 57 | |
| 58 | def tearDown(self): |
| 59 | """Clean up test fixtures""" |
nothing calls this directly
no test coverage detected