| 1 |
import uuid |
| 2 |
|
| 3 |
import globus_sdk |
| 4 |
from globus_sdk.testing import load_response |
| 5 |
|
| 6 |
ENDPOINT_CONFIG = """ |
| 7 |
display_name: My Endpoint |
| 8 |
engine: |
| 9 |
type: GlobusComputeEngine |
| 10 |
""" |
| 11 |
|
| 12 |
|
| 13 |
def test_register_endpoint(compute_client_v2: globus_sdk.ComputeClientV2): |
| 14 |
meta = load_response(compute_client_v2.register_endpoint).metadata |
| 15 |
register_doc = { |
| 16 |
"endpoint_uuid": meta["endpoint_id"], |
| 17 |
"endpoint_name": "my-endpoint", |
| 18 |
"display_name": "My Endpoint", |
| 19 |
"version": "2.31.0", |
| 20 |
"multi_user": False, |
| 21 |
"allowed_functions": [str(uuid.uuid1())], |
| 22 |
"authentication_policy": str(uuid.uuid1()), |
| 23 |
"metadata": { |
| 24 |
"endpoint_config": ENDPOINT_CONFIG.strip(), |
| 25 |
"user_config_template": "", |
| 26 |
"user_config_schema": {}, |
| 27 |
"description": "My endpoint description", |
| 28 |
"ip_address": "140.221.112.13", |
| 29 |
"hostname": "my-hostname", |
| 30 |
"local_user": "user1", |
| 31 |
"sdk_version": "2.31.0", |
| 32 |
"endpoint_version": "2.31.0", |
| 33 |
}, |
| 34 |
} |
| 35 |
|
| 36 |
res = compute_client_v2.register_endpoint(data=register_doc) |
| 37 |
|
| 38 |
assert res.http_status == 200 |
| 39 |
assert res.data["endpoint_id"] == meta["endpoint_id"] |