pulp_2_tests.tests.platform.api_v2.test_user¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.platform.api_v2.test_user
Test the user API endpoints.
The assumptions explored in this module have the following dependencies:
It is possible to create a user.
├── It is impossible to create a duplicate user.
├── It is possible to read a user.
├── It is possible to update a user.
│ └── It is possible to search for a (updated) user.
└── It is possible to delete a user.
-
class
pulp_2_tests.tests.platform.api_v2.test_user.
CreateTestCase
(*args, **kwargs)¶ Bases:
pulp_smash.pulp2.utils.BaseAPITestCase
Establish that we can create users. No prior assumptions are made.
-
classmethod
setUpClass
()¶ Create several users.
Create one user with the minimum required attributes, and another with all available attributes.
-
test_attrs
()¶ Assert that each user has the requested attributes.
-
test_password
()¶ Assert that responses do not contain passwords.
-
test_status_code
()¶ Assert that each response has an HTTP 201 status code.
-
classmethod
-
class
pulp_2_tests.tests.platform.api_v2.test_user.
ReadUpdateDeleteTestCase
(*args, **kwargs)¶ Bases:
pulp_smash.pulp2.utils.BaseAPITestCase
Establish that we can read, update and delete users.
This test case assumes that the assertions in
CreateTestCase
are valid.-
classmethod
setUpClass
()¶ Create three users and read, update and delete them respectively.
-
test_create_duplicate_user
()¶ Verify one cannot create a user with a duplicate login.
-
test_password_not_in_response
()¶ Ensure read and update responses do not contain a password.
-
test_status_code
()¶ Ensure read, update and delete responses have 200 status codes.
-
test_updated_user
()¶ Assert the updated user has the assigned attributes.
-
test_updated_user_password
()¶ Assert one can log in with a user with an updated password.
-
test_use_deleted_user
()¶ Assert one cannot read, update or delete a deleted user.
-
classmethod
-
class
pulp_2_tests.tests.platform.api_v2.test_user.
SearchTestCase
(*args, **kwargs)¶ Bases:
pulp_smash.pulp2.utils.BaseAPITestCase
Establish we can search for users.
This test case assumes the assertions in
ReadUpdateDeleteTestCase
are valid.-
classmethod
setUpClass
()¶ Create a user and add it to the ‘super-users’ role.
Search for:
- Nothing at all:
- All users having only the super-users role.
- All users having no roles.
- A user by their login.
- A non-existent user by their login.
-
test_global_search
()¶ Assert the global search includes our user.
-
test_login_filter_exclusion
()¶ Search for a non-existent user via the “login” filter.
-
test_login_filter_inclusion
()¶ Search for a user via the “login” filter.
-
test_roles_filter_exclusion
()¶ Assert that the “roles” filter can be used for exclusion.
-
test_roles_filter_inclusion
()¶ Assert that the “roles” filter can be used for inclusion.
-
test_status_codes
()¶ Assert each response has an HTTP 200 status code.
-
classmethod