MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / test_from_code

Method test_from_code

tests/test_protocol.py:304–316  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 """Test ErrorMessage"""
303
304 def test_from_code(self) -> None:
305 msg = ErrorMessage.from_code(
306 "req-789",
307 ErrorCode.INSTANCE_NOT_FOUND,
308 "Instance not found: /path/to/project",
309 )
310 d = msg.to_dict()
311
312 assert d["type"] == "ERROR"
313 assert d["id"] == "req-789"
314 assert d["success"] is False
315 assert d["error"]["code"] == "INSTANCE_NOT_FOUND"
316 assert d["error"]["message"] == "Instance not found: /path/to/project"
317
318
319class TestInstancesMessage:

Callers

nothing calls this directly

Calls 2

from_codeMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected