MCPcopy
hub / github.com/mudler/LocalAI / test_parse_options

Method test_parse_options

backend/python/vllm/test.py:152–169  ·  view source on GitHub ↗

Tests _parse_options correctly parses key:value strings.

(self)

Source from the content-addressed store, hash-verified

150 self.assertEqual(result[2]["name"], "foo")
151
152 def test_parse_options(self):
153 """
154 Tests _parse_options correctly parses key:value strings.
155 """
156 import sys, os
157 sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
158 from backend import BackendServicer
159 servicer = BackendServicer()
160 opts = servicer._parse_options([
161 "tool_parser:hermes",
162 "reasoning_parser:deepseek_r1",
163 "invalid_no_colon",
164 "key_with_colons:a:b:c",
165 ])
166 self.assertEqual(opts["tool_parser"], "hermes")
167 self.assertEqual(opts["reasoning_parser"], "deepseek_r1")
168 self.assertEqual(opts["key_with_colons"], "a:b:c")
169 self.assertNotIn("invalid_no_colon", opts)
170
171 def test_apply_engine_args_known_keys(self):
172 """

Callers

nothing calls this directly

Calls 3

_parse_optionsMethod · 0.95
BackendServicerClass · 0.90
insertMethod · 0.45

Tested by

no test coverage detected