def test_verify_missing_deliver_to(chat): msg = Message( author=chat.other, chat=chat, type=MsgType.Text, text="Message", ) with pytest.raises(AssertionError): msg.verify()
def test_verify_text_msg(chat): msg = Message( deliver_to=coordinator.master, author=chat.other, chat=chat, type=MsgType.Text, text="Message", ) msg.verify()
def test_verify_media_msg(chat, master_channel, media_type): with NamedTemporaryFile() as f: msg = Message( deliver_to=master_channel, author=chat.other, chat=chat, type=media_type, file=f, filename="test.bin", path=f.name, mime="application/octet-stream", ) msg.verify()