# coding: utf-8 from utils.test_config import * from utils.string_utils import * from helix_web_services_client.models import UserCommand api = api_as_super() rand = random_string() user_id = "test-user-%s" % rand user_command = UserCommand() user_command.user = user_id user_command.full_name = 'Test User' user_command.email = '%s@example.com' % user_id user_command.job_view = "Owned-By=%s&status=open" % user_id user_command.reviews = ["//depot/dev/...", "//depot/main/..."] api.server_users_post('localhost', user_command) all_users = api.server_users_get('localhost') assert any(b.user == user_id for b in all_users), "did not find new user" saved_user = api.server_users_user_get('localhost', user_id) assert saved_user.full_name == user_command.full_name assert saved_user.job_view == user_command.job_view assert saved_user.reviews == user_command.reviews to_update = UserCommand() to_update.full_name = "Update %s" % rand api.server_users_user_patch('localhost', user_id, to_update) updated = api.server_users_user_get('localhost', user_id) assert updated.full_name == to_update.full_name, "did not update full_name" api.server_users_user_delete('localhost', user_id) all_users2 = api.server_users_get('localhost') assert any(b.user == user_id for b in all_users2) == False, "did not delete new user"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/python/tests/default_api.server_users.crud.py | |||||
#1 | 19307 | tjuricek |
Python Client SDK tests from counters to users Need to treat the job-related models as UserDict instances, which involves some adjustments to the Swagger code generators. |