diff options
author | louiz’ <louiz@louiz.org> | 2017-07-21 17:27:03 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-07-21 17:27:03 +0200 |
commit | 308869aa73c7c03d7e9fad2a780bf132e03c8c5a (patch) | |
tree | bd594a4f2457fa927f0af0168b6adf683b6f65a3 /tests | |
parent | f125de4833d65a83d1f550f4bfbff4d5e4c333b2 (diff) | |
download | biboumi-308869aa73c7c03d7e9fad2a780bf132e03c8c5a.tar.gz biboumi-308869aa73c7c03d7e9fad2a780bf132e03c8c5a.tar.bz2 biboumi-308869aa73c7c03d7e9fad2a780bf132e03c8c5a.tar.xz biboumi-308869aa73c7c03d7e9fad2a780bf132e03c8c5a.zip |
Do not ignore empty values when receiving a data form
Otherwise, these fields cannot be emptied by the user
fix #3281
Diffstat (limited to 'tests')
-rw-r--r-- | tests/end_to_end/__main__.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index 8c2d8e9..c6607d0 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -2551,6 +2551,41 @@ if __name__ == '__main__': ), partial(send_stanza, "<iq type='set' id='id4' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' action='cancel' node='configure' sessionid='{sessionid}' /></iq>"), partial(expect_stanza, "/iq[@type='result']/commands:command[@node='configure'][@status='canceled']"), + + # Same thing, but try to empty some values + partial(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>"), + partial(expect_stanza, "/iq[@type='result']", + after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='configure']", "sessionid")) + ), + partial(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='pass'><value></value></field>" + "<field var='after_connect_command'><value></value></field>" + "<field var='username'><value></value></field>" + "<field var='realname'><value></value></field>" + "<field var='encoding_out'><value></value></field>" + "<field var='encoding_in'><value></value></field>" + "</x></command></iq>"), + partial(expect_stanza, "/iq[@type='result']/commands:command[@node='configure'][@status='completed']/commands:note[@type='info'][text()='Configuration successfully applied.']"), + + partial(send_stanza, "<iq type='set' id='id3' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), + partial(expect_stanza, ("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", + "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure the IRC server irc.localhost']", + "/iq/commands:command/dataform:x[@type='form']/dataform:instructions[text()='Edit the form, to configure the settings of the IRC server irc.localhost']", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='pass']/dataform:value", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='after_connect_command']/dataform:value", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='username']/dataform:value", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='realname']/dataform:value", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='encoding_in']/dataform:value", + "!/iq/commands:command/dataform:x[@type='form']/dataform:field[@var='encoding_out']/dataform:value", + "/iq/commands:command/commands:actions/commands:next", + ), + after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='configure']", "sessionid")) + ), + partial(send_stanza, "<iq type='set' id='id4' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' action='cancel' node='configure' sessionid='{sessionid}' /></iq>"), + partial(expect_stanza, "/iq[@type='result']/commands:command[@node='configure'][@status='canceled']"), + ]), Scenario("irc_channel_configure", [ |