()
| 34 | |
| 35 | |
| 36 | def test_rich_template_message(): |
| 37 | pic1, pic2, pic3 = ( |
| 38 | FakeMessageSegment.image("file:///pic1.jpg"), |
| 39 | FakeMessageSegment.image("file:///pic2.jpg"), |
| 40 | FakeMessageSegment.image("file:///pic3.jpg"), |
| 41 | ) |
| 42 | |
| 43 | template = FakeMessage.template("{}{}" + pic2 + "{}") |
| 44 | |
| 45 | result = template.format(pic1, "[fake:image]", pic3) |
| 46 | |
| 47 | assert result["image"] == FakeMessage([pic1, pic2, pic3]) |
| 48 | assert str(result) == ( |
| 49 | "[fake:image]" + escape_text("[fake:image]") + "[fake:image]" + "[fake:image]" |
| 50 | ) |
| 51 | |
| 52 | |
| 53 | def test_message_injection(): |
nothing calls this directly
no test coverage detected