summaryrefslogtreecommitdiff
path: root/tests/end_to_end/scenarios/self_ping_not_in_muc.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/end_to_end/scenarios/self_ping_not_in_muc.py')
-rw-r--r--tests/end_to_end/scenarios/self_ping_not_in_muc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/end_to_end/scenarios/self_ping_not_in_muc.py b/tests/end_to_end/scenarios/self_ping_not_in_muc.py
new file mode 100644
index 0000000..eb7d092
--- /dev/null
+++ b/tests/end_to_end/scenarios/self_ping_not_in_muc.py
@@ -0,0 +1,15 @@
+from scenarios import *
+
+scenario = (
+ scenarios.simple_channel_join.scenario,
+
+ # Send a ping to ourself, in a muc where we’re not
+ send_stanza("<iq type='get' from='{jid_one}/{resource_one}' id='first_ping' to='#nil%{irc_server_one}/{nick_one}'><ping xmlns='urn:xmpp:ping' /></iq>"),
+ # Immediately receive an error
+ expect_stanza("/iq[@from='#nil%{irc_server_one}/{nick_one}'][@type='error'][@to='{jid_one}/{resource_one}'][@id='first_ping']/error/stanza:not-acceptable"),
+
+ # Send a ping to ourself, in a muc where we are, but not this resource
+ send_stanza("<iq type='get' from='{jid_one}/{resource_two}' id='first_ping' to='#foo%{irc_server_one}/{nick_one}'><ping xmlns='urn:xmpp:ping' /></iq>"),
+ # Immediately receive an error
+ expect_stanza("/iq[@from='#foo%{irc_server_one}/{nick_one}'][@type='error'][@to='{jid_one}/{resource_two}'][@id='first_ping']/error/stanza:not-acceptable"),
+)