summaryrefslogtreecommitdiff
path: root/tests/end_to_end
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-19 23:33:07 +0200
committerlouiz’ <louiz@louiz.org>2017-04-19 23:33:48 +0200
commit51696c091cc7058b05b33f1085b1246f3b5dc59f (patch)
tree9ed811ffecaf8a0a41fbacea6f23cef57497e4ef /tests/end_to_end
parent47ff1cd3116424342c79d173d30a0f118859bc9f (diff)
downloadbiboumi-51696c091cc7058b05b33f1085b1246f3b5dc59f.tar.gz
biboumi-51696c091cc7058b05b33f1085b1246f3b5dc59f.tar.bz2
biboumi-51696c091cc7058b05b33f1085b1246f3b5dc59f.tar.xz
biboumi-51696c091cc7058b05b33f1085b1246f3b5dc59f.zip
Make sure the channel is joined before trying to leave it
fix #3243
Diffstat (limited to 'tests/end_to_end')
-rw-r--r--tests/end_to_end/__main__.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 4ca7ff8..8be5078 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -2457,11 +2457,24 @@ if __name__ == '__main__':
handshake_sequence(),
partial(send_stanza, "<presence type='subscribe' from='{jid_one}/{resource_one}' to='{biboumi_host}' id='sub1' />"),
partial(expect_stanza, "/presence[@to='{jid_one}'][@from='{biboumi_host}'][@type='subscribed']")
- ], conf='fixed_server')
-
+ ], conf='fixed_server'),
+ Scenario("leave_unjoined_chan",
+ [
+ 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"),
+ partial(expect_stanza, "/presence"),
+ partial(expect_stanza, "/message"),
+
+ partial(send_stanza, "<presence from='{jid_two}/{resource_two}' to='#foo%{irc_server_one}/{nick_one}' />"),
+ connection_begin_sequence("irc.localhost", '{jid_two}/{resource_two}'),
+ partial(expect_stanza, "/message[@to='{jid_two}/{resource_two}'][@type='chat']/body[text()='irc.localhost: {nick_one}: Nickname is already in use.']"),
+ partial(expect_stanza, "/presence[@type='error']/error[@type='cancel'][@code='409']/stanza:conflict"),
+ partial(send_stanza, "<presence from='{jid_two}/{resource_two}' to='#foo%{irc_server_one}/{nick_one}' type='unavailable' />")
+ ])
)
-
failures = 0
scenar_list = sys.argv[1:]