MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / _test

Method _test

tests/engine/test_async_llm.py:143–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 """EngineServiceClient.start should log and re-raise on internal exception"""
142
143 async def _test():
144 from unittest.mock import patch
145
146 from fastdeploy.engine.async_llm import EngineServiceClient
147
148 class DummyCfg:
149 pass
150
151 client = EngineServiceClient(DummyCfg(), pid=12345)
152
153 # Force _start_engine_process to raise so that start() enters exception block
154 with patch.object(client, "_start_engine_process", side_effect=RuntimeError("boom")):
155 with self.assertRaises(RuntimeError):
156 await client.start()
157
158 return True
159
160 result = self.run_async_test(_test())
161 self.assertTrue(result)

Callers

nothing calls this directly

Calls 15

startMethod · 0.95
_start_engine_processMethod · 0.95
_generate_singleMethod · 0.95
_process_outputMethod · 0.95
to_dictMethod · 0.95
EngineServiceClientClass · 0.90
SamplingParamsClass · 0.90
EngineArgsClass · 0.90
RequestMetricsClass · 0.90
CompletionOutputClass · 0.90
RequestOutputClass · 0.90

Tested by

no test coverage detected