summaryrefslogtreecommitdiff
path: root/tests/end_to_end
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-11-07 21:51:39 +0100
committerlouiz’ <louiz@louiz.org>2016-11-07 21:51:39 +0100
commitf36bccd7bbd685cc34370da4ab4b7d124bcc69a0 (patch)
treec80d80a58e1bc42b27011767338765559a795f4e /tests/end_to_end
parenta52baa52e25c9767d1be95a10b2a56334aaeb471 (diff)
downloadbiboumi-f36bccd7bbd685cc34370da4ab4b7d124bcc69a0.tar.gz
biboumi-f36bccd7bbd685cc34370da4ab4b7d124bcc69a0.tar.bz2
biboumi-f36bccd7bbd685cc34370da4ab4b7d124bcc69a0.tar.xz
biboumi-f36bccd7bbd685cc34370da4ab4b7d124bcc69a0.zip
Test the error on joining invalid room
Diffstat (limited to 'tests/end_to_end')
-rw-r--r--tests/end_to_end/__main__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 239f044..7658d92 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -113,6 +113,7 @@ def match(stanza, xpath):
tree = lxml.etree.parse(io.StringIO(str(stanza)))
matched = tree.xpath(xpath, namespaces={'re': 'http://exslt.org/regular-expressions',
'muc_user': 'http://jabber.org/protocol/muc#user',
+ 'muc': 'http://jabber.org/protocol/muc',
'disco_info': 'http://jabber.org/protocol/disco#info',
'muc_traffic': 'http://jabber.org/protocol/muc#traffic',
'disco_items': 'http://jabber.org/protocol/disco#items',
@@ -1836,6 +1837,22 @@ if __name__ == '__main__':
partial(send_stanza, "<iq type='set' id='command2' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='get-irc-connection-info' action='execute' /></iq>"),
partial(expect_stanza, r"/iq/commands:command/commands:note[re:test(text(), 'Connected to IRC server irc.localhost on port 6667 since \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \(\d+ seconds ago\)\.\n#foo from 1 resource: {resource_one}.*')]"),
], conf='fixed_server'),
+ Scenario("invalid_room_jid",
+ [
+ handshake_sequence(),
+ partial(send_stanza, "<presence from='{jid_one}/{resource_one}' to='invalid%{irc_server_one}/{nick_one}' />"),
+ partial(expect_stanza, ("/presence[@type='error'][@to='{jid_one}/{resource_one}'][@from='invalid%{irc_server_one}/{nick_one}']/error[@type='cancel']/stanza:item-not-found",
+ "/presence/muc:x",
+ "/presence/error/stanza:text")),
+ ]),
+ Scenario("invalid_room_jid_fixed",
+ [
+ handshake_sequence(),
+ partial(send_stanza, "<presence from='{jid_one}/{resource_one}' to='invalid@{biboumi_host}/{nick_one}' />"),
+ partial(expect_stanza, ("/presence[@type='error'][@to='{jid_one}/{resource_one}'][@from='invalid@{biboumi_host}/{nick_one}']/error[@type='cancel']/stanza:item-not-found",
+ "/presence/muc:x",
+ "/presence/error/stanza:text")),
+ ], conf='fixed_server'),
)