MCPcopy Create free account
hub / github.com/IBM/mcp-cli / test_from_state

Method test_from_state

tests/display/test_models.py:285–296  ·  view source on GitHub ↗

Test creating update from state.

(self)

Source from the content-addressed store, hash-verified

283 """Tests for DisplayUpdate model."""
284
285 def test_from_state(self):
286 """Test creating update from state."""
287 state = StreamingState()
288 state.add_chunk(StreamingChunk(content="def hello():"))
289
290 update = DisplayUpdate.from_state(state)
291
292 assert update.content == "def hello():"
293 assert update.content_type == ContentType.CODE
294 assert update.phase == StreamingPhase.RECEIVING
295 assert update.chunks_received == 1
296 assert update.show_spinner is True
297
298 def test_from_completed_state(self):
299 """Test update from completed state."""

Callers

nothing calls this directly

Calls 4

add_chunkMethod · 0.95
StreamingStateClass · 0.90
StreamingChunkClass · 0.90
from_stateMethod · 0.80

Tested by

no test coverage detected