summaryrefslogtreecommitdiff
path: root/tests/test_stanza_xep_0004.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2011-08-12 16:36:03 -0700
committerNathan Fritz <fritzy@netflint.net>2011-08-12 16:36:03 -0700
commit8f1d0e7a79b662e5f2849cea6e73716cc887e226 (patch)
treeec2fe16b50effd4ba5787a57de00c514fad4f333 /tests/test_stanza_xep_0004.py
parent88184ff9556774b1be3dc7fcb97f1f71803d2d61 (diff)
parent9b7ed73f95145f88887d6fc3daa1bd2a9596b943 (diff)
downloadslixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.gz
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.bz2
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.tar.xz
slixmpp-8f1d0e7a79b662e5f2849cea6e73716cc887e226.zip
Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop
Diffstat (limited to 'tests/test_stanza_xep_0004.py')
-rw-r--r--tests/test_stanza_xep_0004.py41
1 files changed, 23 insertions, 18 deletions
diff --git a/tests/test_stanza_xep_0004.py b/tests/test_stanza_xep_0004.py
index bdc4a878..22f8b77d 100644
--- a/tests/test_stanza_xep_0004.py
+++ b/tests/test_stanza_xep_0004.py
@@ -1,4 +1,6 @@
from sleekxmpp.test import *
+from sleekxmpp.thirdparty import OrderedDict
+
import sleekxmpp.plugins.xep_0004 as xep_0004
@@ -47,21 +49,25 @@ class TestDataForms(SleekTest):
</message>
""")
- form['fields'] = [('f1', {'type': 'text-single',
- 'label': 'Username',
- 'required': True}),
- ('f2', {'type': 'text-private',
- 'label': 'Password',
- 'required': True}),
- ('f3', {'type': 'text-multi',
- 'label': 'Message',
- 'value': 'Enter message.\nA long one even.'}),
- ('f4', {'type': 'list-single',
- 'label': 'Message Type',
- 'options': [{'label': 'Cool!',
- 'value': 'cool'},
- {'label': 'Urgh!',
- 'value': 'urgh'}]})]
+ fields = OrderedDict()
+ fields['f1'] = {'type': 'text-single',
+ 'label': 'Username',
+ 'required': True}
+ fields['f2'] = {'type': 'text-private',
+ 'label': 'Password',
+ 'required': True}
+ fields['f3'] = {'type': 'text-multi',
+ 'label': 'Message',
+ 'value': 'Enter message.\nA long one even.'}
+ fields['f4'] = {'type': 'list-single',
+ 'label': 'Message Type',
+ 'options': [{'label': 'Cool!',
+ 'value': 'cool'},
+ {'label': 'Urgh!',
+ 'value': 'urgh'}]}
+ form['fields'] = fields
+
+
self.check(msg, """
<message>
<x xmlns="jabber:x:data" type="form">
@@ -92,9 +98,8 @@ class TestDataForms(SleekTest):
msg = self.Message()
form = msg['form']
- form.setFields([
- ('foo', {'type': 'text-single'}),
- ('bar', {'type': 'list-multi'})])
+ form.add_field(var='foo', ftype='text-single')
+ form.add_field(var='bar', ftype='list-multi')
form.setValues({'foo': 'Foo!',
'bar': ['a', 'b']})