MCPcopy Create free account
hub / github.com/Lightning-AI/LitServe / test_simple_stream_api_without_server

Function test_simple_stream_api_without_server

tests/unit/test_examples.py:76–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75@pytest.mark.asyncio
76async def test_simple_stream_api_without_server():
77 api = SimpleStreamAPI()
78 api.setup(None)
79 assert api.model is not None, "Model should be loaded after setup"
80 assert api.decode_request({"input": 4}) == 4, "Request should be decoded"
81 assert list(api.predict(4)) == ["0: 4", "1: 4", "2: 4"], "Model should be able to predict"
82 assert list(api.encode_response(["0: 4", "1: 4", "2: 4"])) == [
83 {"output": "0: 4"},
84 {"output": "1: 4"},
85 {"output": "2: 4"},
86 ], "Response should be encoded"
87
88
89@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 5

setupMethod · 0.95
decode_requestMethod · 0.95
predictMethod · 0.95
encode_responseMethod · 0.95
SimpleStreamAPIClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…