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

Function test_init_tool_parser_plugin

tests/entrypoints/test_llm.py:96–118  ·  view source on GitHub ↗
(monkeypatch)

Source from the content-addressed store, hash-verified

94
95
96def test_init_tool_parser_plugin(monkeypatch):
97 captured = {}
98 engine = _make_engine()
99
100 class DummyThread:
101 def __init__(self, target, daemon):
102 self.target = target
103
104 def start(self):
105 return None
106
107 monkeypatch.setattr(llm_module, "deprecated_kwargs_warning", lambda **_: None)
108 monkeypatch.setattr(llm_module, "retrive_model_from_server", lambda model, rev: model)
109 monkeypatch.setattr(
110 llm_module.ToolParserManager, "import_tool_parser", lambda name: captured.setdefault("p", name)
111 )
112 monkeypatch.setattr(llm_module, "EngineArgs", lambda **kwargs: SimpleNamespace(**kwargs))
113 monkeypatch.setattr(llm_module.LLMEngine, "from_engine_args", lambda engine_args: engine)
114 monkeypatch.setattr(llm_module, "load_chat_template", lambda template, model: "tmpl")
115 monkeypatch.setattr(llm_module.threading, "Thread", DummyThread)
116 llm = LLM(model="m", tool_parser_plugin="plugin")
117 assert captured["p"] == "plugin"
118 assert llm.master_node_ip == "127.0.0.1"
119
120
121def test_receive_output_merges():

Callers

nothing calls this directly

Calls 2

LLMClass · 0.90
_make_engineFunction · 0.85

Tested by

no test coverage detected