MCPcopy
hub / github.com/nonebot/nonebot2 / test_message_injection

Function test_message_injection

tests/test_adapters/test_template.py:53–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def test_message_injection():
54 template = FakeMessage.template("{name}Is Bad")
55 message = template.format(name="[fake:image]")
56
57 assert message.extract_plain_text() == escape_text("[fake:image]Is Bad")
58
59
60def test_malformed_template():

Callers

nothing calls this directly

Calls 4

escape_textFunction · 0.90
templateMethod · 0.80
formatMethod · 0.80
extract_plain_textMethod · 0.80

Tested by

no test coverage detected