summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-06-10 10:00:48 +0200
committerlouiz’ <louiz@louiz.org>2016-06-10 10:00:48 +0200
commit272c0e4995f2fe94fb2366c15453fdada341861a (patch)
treec1023991d62b9e4b0e798ba82bfdc25e00024724 /tests
parent7540f6793342aeb1e9cec53208b347ca8a346c36 (diff)
downloadbiboumi-272c0e4995f2fe94fb2366c15453fdada341861a.tar.gz
biboumi-272c0e4995f2fe94fb2366c15453fdada341861a.tar.bz2
biboumi-272c0e4995f2fe94fb2366c15453fdada341861a.tar.xz
biboumi-272c0e4995f2fe94fb2366c15453fdada341861a.zip
Reset the preferred private JID when all resources leave a room
For example if we are talking in private with nick Joe from room #foo, and then we leave that room, we start receiving Joe’s message from the server-wide JID e2e tests included!!!
Diffstat (limited to 'tests')
-rw-r--r--tests/end_to_end/__main__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 1408ea9..0e2ca64 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -303,6 +303,7 @@ common_replacements = {
'jid_admin': 'admin@example.com',
'nick_two': 'Bobby',
'lower_nick_one': 'nick',
+ 'lower_nick_two': 'bobby',
}
@@ -673,6 +674,17 @@ if __name__ == '__main__':
partial(send_stanza, "<message from='{jid_two}/{resource_one}' to='{lower_nick_one}!{irc_server_one}' type='chat'><body>re</body></message>"),
# The response is received from the in-room JID
partial(expect_stanza, "/message[@from='%{irc_server_one}/{nick_two}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='re']"),
+
+ # Now we leave the room, to check if the subsequent private messages are still received properly
+ partial(send_stanza,
+ "<presence from='{jid_one}/{resource_one}' to='%{irc_server_one}/{nick_one}' type='unavailable' />"),
+ partial(expect_stanza,
+ "/presence[@type='unavailable']/muc_user:x/muc_user:status[@code='110']"),
+
+ # The private messages from this nick should now come (again) from the server-wide JID
+ partial(send_stanza, "<message from='{jid_two}/{resource_one}' to='{lower_nick_one}!{irc_server_one}' type='chat'><body>hihihoho</body></message>"),
+ partial(expect_stanza,
+ "/message[@from='{lower_nick_two}!{irc_server_one}'][@to='{jid_one}/{resource_one}']"),
]
)
)