summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-17 15:01:59 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-04-17 15:01:59 +0200
commite4790591a9bc6d7e1b7f9a6139cf78d1282ae257 (patch)
treea1d74b5ce93b6fd894e164147289617bc1146163
parent45df636fd79e7f1c909136daef47fbad724b560a (diff)
downloadpykolab-e4790591a9bc6d7e1b7f9a6139cf78d1282ae257.tar.gz
Add a test for the wap api form_value service select_options method
-rw-r--r--tests/functional/test_wap_client/test_006_form_value_select_options.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/functional/test_wap_client/test_006_form_value_select_options.py b/tests/functional/test_wap_client/test_006_form_value_select_options.py
new file mode 100644
index 0000000..92b4992
--- /dev/null
+++ b/tests/functional/test_wap_client/test_006_form_value_select_options.py
@@ -0,0 +1,31 @@
+import time
+import unittest
+
+import pykolab
+from pykolab import wap_client
+
+conf = pykolab.getConf()
+
+class TestFormValueListOptions(unittest.TestCase):
+
+ def test_001_list_options_user_preferredlanguage(self):
+ conf = pykolab.getConf()
+ conf.finalize_conf(fatal=False)
+
+ self.login = conf.get('ldap', 'bind_dn')
+ self.password = conf.get('ldap', 'bind_pw')
+ self.domain = conf.get('kolab', 'primary_domain')
+
+ result = wap_client.authenticate(self.login, self.password, self.domain)
+
+ attribute_values = wap_client.form_value_select_options(
+ 'user',
+ 1,
+ 'preferredlanguage'
+ )
+
+ self.assertTrue(attribute_values['preferredlanguage'].has_key('default'))
+ self.assertTrue(attribute_values['preferredlanguage'].has_key('list'))
+ self.assertTrue(len(attribute_values['preferredlanguage']['list']) > 1)
+ self.assertTrue(attribute_values['preferredlanguage']['default'] in attribute_values['preferredlanguage']['list'])
+