from scenarios import *
scenario = (
scenarios.simple_channel_join.scenario,
# Send a channel message
send_stanza("coucou"),
# Receive the message
expect_stanza("/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_one}/{resource_one}'][@type='groupchat']/body[text()='coucou']",
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"),
# Send a message from a resource that is not joined
send_stanza("coucou"),
expect_stanza("/message[@type='error']/error[@type='modify']/stanza:text[text()='You are not a participant in this room.']",
"/message/error/stanza:not-acceptable"
),
)