()
| 48 | |
| 49 | |
| 50 | def test_segment_validate(): |
| 51 | assert type_validate_python( |
| 52 | FakeMessageSegment, |
| 53 | {"type": "text", "data": {"text": "text"}, "extra": "should be ignored"}, |
| 54 | ) == FakeMessageSegment.text("text") |
| 55 | with pytest.raises(ValidationError): |
| 56 | type_validate_python( |
| 57 | type("FakeMessageSegment2", (MessageSegment,), {}), |
| 58 | FakeMessageSegment.text("text"), |
| 59 | ) |
| 60 | |
| 61 | with pytest.raises(ValidationError): |
| 62 | type_validate_python(FakeMessageSegment, "some str") |
| 63 | |
| 64 | with pytest.raises(ValidationError): |
| 65 | type_validate_python(FakeMessageSegment, {"data": {}}) |
| 66 | |
| 67 | |
| 68 | def test_segment_join(): |
nothing calls this directly
no test coverage detected