Test creating update from state.
(self)
| 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.""" |
nothing calls this directly
no test coverage detected