summaryrefslogtreecommitdiff
path: root/tests/end_to_end/scenarios/self_ping_not_in_muc.py
blob: eb7d09250f001fb16e057676a7727ceb33b582e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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"),
)