@@ -1139,6 +1139,34 @@ if __name__ == '__main__':
|
||||
partial(expect_stanza,
|
||||
"/iq[@from='#foo%{irc_server_one}/{nick_one}'][@type='result'][@to='{jid_one}/{resource_one}'][@id='first_ping']"),
|
||||
]),
|
||||
Scenario("self_ping_not_in_muc",
|
||||
[
|
||||
handshake_sequence(),
|
||||
partial(send_stanza,
|
||||
"<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
|
||||
connection_sequence("irc.localhost", '{jid_one}/{resource_one}'),
|
||||
partial(expect_stanza,
|
||||
"/message/body[text()='Mode #foo [+nt] by {irc_host_one}']"),
|
||||
partial(expect_stanza,
|
||||
("/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']",
|
||||
"/presence/muc_user:x/muc_user:status[@code='110']")
|
||||
),
|
||||
partial(expect_stanza, "/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
|
||||
|
||||
# Send a ping to ourself, in a muc where we’re not
|
||||
partial(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
|
||||
partial(expect_stanza,
|
||||
"/iq[@from='#nil%{irc_server_one}/{nick_one}'][@type='error'][@to='{jid_one}/{resource_one}'][@id='first_ping']/error/stanza:not-allowed"),
|
||||
|
||||
# Send a ping to ourself, in a muc where we are, but not this resource
|
||||
partial(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
|
||||
partial(expect_stanza,
|
||||
"/iq[@from='#foo%{irc_server_one}/{nick_one}'][@type='error'][@to='{jid_one}/{resource_two}'][@id='first_ping']/error/stanza:not-allowed"),
|
||||
]),
|
||||
Scenario("self_ping_on_real_channel",
|
||||
[
|
||||
handshake_sequence(),
|
||||
|
||||
Reference in New Issue
Block a user