summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-09-17 22:35:59 +0200
committerlouiz’ <louiz@louiz.org>2018-09-17 22:35:59 +0200
commit08085d862fc7390eab6d6492040b178801096b82 (patch)
tree29de6a4e51c9c66d4936c5b18348891e70250d16
parenteb082d152dbf682e3c670e2ab6091298b01a1e63 (diff)
downloadbiboumi-08085d862fc7390eab6d6492040b178801096b82.tar.gz
biboumi-08085d862fc7390eab6d6492040b178801096b82.tar.bz2
biboumi-08085d862fc7390eab6d6492040b178801096b82.tar.xz
biboumi-08085d862fc7390eab6d6492040b178801096b82.zip
Add a test demonstrating #3378
-rw-r--r--tests/end_to_end/__main__.py38
1 files changed, 36 insertions, 2 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index d57f375..cb92cb0 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -655,9 +655,9 @@ if __name__ == '__main__':
partial(send_stanza,
"<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
partial(send_stanza,
- "<presence from='{jid_one}/{resource_one}' to='#bar%{irc_server_one}/{nick_one}' />"),
+ "<presence from='{jid_one}/{resource_one}' to='#bar%{irc_server_one}/{nick_two}' />"),
partial(send_stanza,
- "<presence from='{jid_one}/{resource_one}' to='#baz%{irc_server_one}/{nick_one}'> <x xmlns='http://jabber.org/protocol/muc'><password>SECRET</password></x></presence>"),
+ "<presence from='{jid_one}/{resource_one}' to='#baz%{irc_server_one}/{nick_three}'> <x xmlns='http://jabber.org/protocol/muc'><password>SECRET</password></x></presence>"),
connection_sequence("irc.localhost", '{jid_one}/{resource_one}'),
@@ -685,6 +685,40 @@ if __name__ == '__main__':
),
partial(expect_stanza, "/message[@from='#baz%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
]),
+ Scenario("nick_change_in_join",
+ [
+ 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())]"),
+
+ partial(send_stanza,
+ "<presence from='{jid_one}/{resource_one}' to='#bar%{irc_server_one}/{nick_two}' />"),
+ partial(expect_stanza,
+ "/message/body[text()='Mode #bar [+nt] by {irc_host_one}']"),
+ partial(expect_stanza,
+ ("/presence[@to='{jid_one}/{resource_one}'][@from='#bar%{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='#bar%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
+
+ partial(send_stanza,
+ "<presence from='{jid_one}/{resource_one}' to='#boule%{irc_server_one}/{nick_two}' />"),
+ partial(expect_stanza,
+ "/message/body[text()='Mode #boule [+nt] by {irc_host_one}']"),
+ partial(expect_stanza,
+ ("/presence[@to='{jid_one}/{resource_one}'][@from='#boule%{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='#boule%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
+ ]),
Scenario("not_connected_error",
[
handshake_sequence(),