summaryrefslogtreecommitdiff
path: root/tests/end_to_end
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-12-11 17:05:52 +0100
committerlouiz’ <louiz@louiz.org>2016-12-11 17:05:52 +0100
commiteca31ce8db104f17ac74fd74aa9d7ef7e8f1470a (patch)
tree97399877e23af6f09aad646bfe4ba46027bf16d0 /tests/end_to_end
parentf653906f9de8cbcecf5717e18c696d1029fc2c8f (diff)
downloadbiboumi-eca31ce8db104f17ac74fd74aa9d7ef7e8f1470a.tar.gz
biboumi-eca31ce8db104f17ac74fd74aa9d7ef7e8f1470a.tar.bz2
biboumi-eca31ce8db104f17ac74fd74aa9d7ef7e8f1470a.tar.xz
biboumi-eca31ce8db104f17ac74fd74aa9d7ef7e8f1470a.zip
Do not change the nick when joining a second room with a different nick
As the doc says, the nick changes must be explicit in an already joined room, and not when joining a room.
Diffstat (limited to 'tests/end_to_end')
-rw-r--r--tests/end_to_end/__main__.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index ddce3f0..b265200 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -798,6 +798,33 @@ if __name__ == '__main__':
("/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='second']",),
]),
]),
+ Scenario("channel_join_with_different_nick",
+ [
+ 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'][@to='{jid_one}/{resource_one}']/subject[not(text())]"),
+
+ # The same resource joins a different channel with a different nick
+ partial(send_stanza,
+ "<presence from='{jid_one}/{resource_one}' to='#bar%{irc_server_one}/{nick_two}' />"),
+
+ # We must receive a join presence in response, without any nick change (nick_two) must be ignored
+ 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'][@to='{jid_one}/{resource_one}']/subject[not(text())]"),
+ ]),
Scenario("channel_messages",
[
handshake_sequence(),