summaryrefslogtreecommitdiff
path: root/tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py')
-rw-r--r--tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py b/tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py
new file mode 100644
index 0000000..bffe3aa
--- /dev/null
+++ b/tests/end_to_end/scenarios/muc_message_from_unjoined_resource.py
@@ -0,0 +1,16 @@
+from scenarios import *
+
+scenario = (
+ scenarios.simple_channel_join.scenario,
+
+ # Send a channel message
+ send_stanza("<message from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}' type='groupchat'><body>coucou</body></message>"),
+ # 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("<message from='{jid_one}/{resource_two}' to='#foo%{irc_server_one}' type='groupchat'><body>coucou</body></message>"),
+ expect_stanza("/message[@type='error']/error[@type='modify']/stanza:text[text()='You are not a participant in this room.']",
+ "/message/error/stanza:not-acceptable"
+ ),
+)