summaryrefslogtreecommitdiffstats
path: root/tests/functional/user_add.py
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-04 15:53:48 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-04 15:53:48 +0200
commitc204eaaa2c9a006432fe00489a352833143db01d (patch)
tree18860f2e335b9a98d34f404d5c4b81d22f2ce222 /tests/functional/user_add.py
parent4a24e0cc403321713ee1201ade9d36956da1c060 (diff)
downloadpykolab-c204eaaa2c9a006432fe00489a352833143db01d.tar.gz
CS fixes according to PEP8 (ignored mostly line-length errors only)
Summary: . Reviewers: #pykolab_developers Differential Revision: https://git.kolab.org/D134
Diffstat (limited to 'tests/functional/user_add.py')
-rw-r--r--tests/functional/user_add.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/functional/user_add.py b/tests/functional/user_add.py
index b1b37f1..35e2b6b 100644
--- a/tests/functional/user_add.py
+++ b/tests/functional/user_add.py
@@ -4,17 +4,12 @@ from pykolab import wap_client
conf = pykolab.getConf()
-def user_add(givenname, sn, preferredlanguage='en_US', **kw):
- if givenname == None:
- raise Exception
-
- if givenname == '':
- raise Exception
- if sn == None:
+def user_add(givenname, sn, preferredlanguage='en_US', **kw):
+ if givenname is None or givenname == '':
raise Exception
- if sn == '':
+ if sn is None or sn == '':
raise Exception
user_details = {
@@ -51,7 +46,7 @@ def user_add(givenname, sn, preferredlanguage='en_US', **kw):
attr_details = user_type_info['form_fields'][attribute]
if isinstance(attr_details, dict):
- if not attr_details.has_key('optional') or attr_details['optional'] == False or user_details.has_key(attribute):
+ if 'optional' not in attr_details or attr_details['optional'] is False or attribute in user_details:
params[attribute] = user_details[attribute]
elif isinstance(attr_details, list):
params[attribute] = user_details[attribute]
@@ -59,7 +54,6 @@ def user_add(givenname, sn, preferredlanguage='en_US', **kw):
fvg_params = params
fvg_params['object_type'] = 'user'
fvg_params['type_id'] = user_type_id
- fvg_params['attributes'] = [attr for attr in user_type_info['auto_form_fields'].keys() if not attr in params.keys()]
+ fvg_params['attributes'] = [attr for attr in user_type_info['auto_form_fields'].keys() if attr not in params]
result = wap_client.user_add(params)
-