1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
14 except arvados.errors.ApiError:
17 existing = api.users().list(filters=[["email", "=", "test@example.com"],
18 ["is_active", "=", True]], limit=1).execute()
20 u = existing["items"][0]
22 u = api.users().create(body={
25 'email': 'test@example.com',
28 api.users().activate(uuid=u["uuid"]).execute()
30 tok = api.api_client_authorizations().create(body={
31 "api_client_authorization": {
32 "owner_uuid": u["uuid"]
36 with open("cwl.output.json", "w") as f:
38 "test_user_uuid": u["uuid"],
39 "test_user_token": "v2/%s/%s" % (tok["uuid"], tok["api_token"])