diff options
author | louiz’ <louiz@louiz.org> | 2019-11-03 22:30:20 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2019-11-06 17:22:38 +0100 |
commit | 752cb86d8a5db9e89648c7002dcef6bc20c197eb (patch) | |
tree | fc6d41c64e5844a28452cd6fdb1c20717390ab39 /tests | |
parent | 438b7fb803442dd7a1522cc9c44001307ac8196a (diff) | |
download | biboumi-752cb86d8a5db9e89648c7002dcef6bc20c197eb.tar.gz biboumi-752cb86d8a5db9e89648c7002dcef6bc20c197eb.tar.bz2 biboumi-752cb86d8a5db9e89648c7002dcef6bc20c197eb.tar.xz biboumi-752cb86d8a5db9e89648c7002dcef6bc20c197eb.zip |
e2e: Test the behaviour on bad integer value for ad-hoc confs
Diffstat (limited to 'tests')
-rw-r--r-- | tests/end_to_end/scenarios/configure_bad_value.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/end_to_end/scenarios/configure_bad_value.py b/tests/end_to_end/scenarios/configure_bad_value.py new file mode 100644 index 0000000..83b9b11 --- /dev/null +++ b/tests/end_to_end/scenarios/configure_bad_value.py @@ -0,0 +1,23 @@ +from scenarios import * + +scenario = ( + sequences.handshake(), + + # Configure the throttle option with an incorrect value + send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), + expect_stanza("/iq[@type='result']", + after = save_value("sessionid", extract_attribute("/iq[@type='result']/commands:command[@node='configure']", "sessionid"))), + send_stanza("<iq type='set' id='id2' from='{jid_one}/{resource_one}' to='{irc_server_one}'>" + "<command xmlns='http://jabber.org/protocol/commands' node='configure' sessionid='{sessionid}' action='next'>" + "<x xmlns='jabber:x:data' type='submit'>" + "<field var='throttle_limit'><value>bleh</value></field>" + "<field var='max_history_length'><value>bleh</value></field>" + "</x></command></iq>"), + expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@status='completed']"), + + # These options should have their default value + send_stanza("<iq type='set' id='id2' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), + expect_stanza("/iq[@type='result']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='throttle_limit']/dataform:value[text()='10']", + "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='max_history_length']/dataform:value[text()='20']"), +) |