| 1 | from .conftest import get_client, verify_request_count |
| 2 | |
| 3 | |
| 4 | def test_clients_list_() -> None: |
| 5 | """Test list endpoint with WireMock""" |
| 6 | test_id = "clients.list_.0" |
| 7 | client = get_client(test_id) |
| 8 | client.clients.list( |
| 9 | fields="fields", |
| 10 | include_fields=True, |
| 11 | page=1, |
| 12 | per_page=1, |
| 13 | include_totals=True, |
| 14 | is_global=True, |
| 15 | is_first_party=True, |
| 16 | app_type="app_type", |
| 17 | external_client_id="external_client_id", |
| 18 | q="q", |
| 19 | ) |
| 20 | verify_request_count( |
| 21 | test_id, |
| 22 | "GET", |
| 23 | "/clients", |
| 24 | { |
| 25 | "fields": "fields", |
| 26 | "include_fields": "true", |
| 27 | "page": "1", |
| 28 | "per_page": "1", |
| 29 | "include_totals": "true", |
| 30 | "is_global": "true", |
| 31 | "is_first_party": "true", |
| 32 | "app_type": "app_type", |
| 33 | "external_client_id": "external_client_id", |
| 34 | "q": "q", |
| 35 | }, |
| 36 | 1, |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | def test_clients_create() -> None: |
| 41 | """Test create endpoint with WireMock""" |
| 42 | test_id = "clients.create.0" |
| 43 | client = get_client(test_id) |
| 44 | client.clients.create( |
| 45 | name="name", |
| 46 | ) |
| 47 | verify_request_count(test_id, "POST", "/clients", None, 1) |
| 48 | |
| 49 | |
| 50 | def test_clients_preview_cimd_metadata() -> None: |
| 51 | """Test previewCimdMetadata endpoint with WireMock""" |
| 52 | test_id = "clients.preview_cimd_metadata.0" |
| 53 | client = get_client(test_id) |
| 54 | client.clients.preview_cimd_metadata( |
| 55 | external_client_id="external_client_id", |
| 56 | ) |
| 57 | verify_request_count(test_id, "POST", "/clients/cimd/preview", None, 1) |
| 58 | |
| 59 | |
| 60 | def test_clients_register_cimd_client() -> None: |
| 61 | """Test registerCimdClient endpoint with WireMock""" |
| 62 | test_id = "clients.register_cimd_client.0" |
| 63 | client = get_client(test_id) |
| 64 | client.clients.register_cimd_client( |
| 65 | external_client_id="external_client_id", |
| 66 | ) |
| 67 | verify_request_count(test_id, "POST", "/clients/cimd/register", None, 1) |
| 68 | |
| 69 | |
| 70 | def test_clients_get() -> None: |
| 71 | """Test get endpoint with WireMock""" |
| 72 | test_id = "clients.get.0" |
| 73 | client = get_client(test_id) |
| 74 | client.clients.get( |
| 75 | id="id", |
| 76 | fields="fields", |
| 77 | include_fields=True, |
| 78 | ) |
| 79 | verify_request_count(test_id, "GET", "/clients/id", {"fields": "fields", "include_fields": "true"}, 1) |
| 80 | |
| 81 | |
| 82 | def test_clients_delete() -> None: |
| 83 | """Test delete endpoint with WireMock""" |
| 84 | test_id = "clients.delete.0" |
| 85 | client = get_client(test_id) |
| 86 | client.clients.delete( |
| 87 | id="id", |
| 88 | ) |
| 89 | verify_request_count(test_id, "DELETE", "/clients/id", None, 1) |
| 90 | |
| 91 | |
| 92 | def test_clients_update() -> None: |
| 93 | """Test update endpoint with WireMock""" |
| 94 | test_id = "clients.update.0" |
| 95 | client = get_client(test_id) |
| 96 | client.clients.update( |
| 97 | id="id", |
| 98 | ) |
| 99 | verify_request_count(test_id, "PATCH", "/clients/id", None, 1) |
| 100 | |
| 101 | |
| 102 | def test_clients_rotate_secret() -> None: |
| 103 | """Test rotateSecret endpoint with WireMock""" |
| 104 | test_id = "clients.rotate_secret.0" |
| 105 | client = get_client(test_id) |
| 106 | client.clients.rotate_secret( |
| 107 | id="id", |
| 108 | ) |
| 109 | verify_request_count(test_id, "POST", "/clients/id/rotate-secret", None, 1) |