add some tests for user api
make a seperate file test_users_negative.py and move exist negative tests
over to it,also add some negative tests to it
- test_create_user_with_enabled_non_bool
- test_create_user_with_enabled
- create_user
- test_update_user_for_non_existant_user
- test_update_user_request_without_a_token
- test_update_user_by_unauthorized_user
- test_delete_user_request_without_a_token
Change-Id: I5a87d72ecb94046809faf0ce14b1af347c2e4dcc
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
index 9d44826..9c0a72c 100644
--- a/tempest/services/identity/xml/identity_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -159,7 +159,7 @@
body = self._parse_body(etree.fromstring(body))
return resp, body
- def create_user(self, name, password, tenant_id, email):
+ def create_user(self, name, password, tenant_id, email, **kwargs):
"""Create a user."""
create_user = Element("user",
xmlns=XMLNS,
@@ -167,6 +167,9 @@
password=password,
tenantId=tenant_id,
email=email)
+ if 'enabled' in kwargs:
+ create_user.add_attr('enabled', str(kwargs['enabled']).lower())
+
resp, body = self.post('users', str(Document(create_user)),
self.headers)
body = self._parse_body(etree.fromstring(body))