|
5 | 5 |
|
6 | 6 |
|
7 | 7 | @pytest.mark.vcr() |
8 | | -def test_webhook_create(webhook_url, test_client): |
9 | | - webhook = test_client.webhook.create(url=webhook_url) |
| 8 | +def test_webhook_create(webhook_url, webhook_secret, webhook_custom_headers, test_client): |
| 9 | + webhook = test_client.webhook.create( |
| 10 | + url=webhook_url, |
| 11 | + webhook_secret=webhook_secret, |
| 12 | + custom_headers=webhook_custom_headers, |
| 13 | + ) |
10 | 14 |
|
11 | 15 | assert isinstance(webhook, Webhook) |
12 | 16 | assert str.startswith(webhook.id, "hook_") |
13 | 17 | assert webhook.url == webhook_url |
| 18 | + assert webhook.custom_headers[0]["name"] == "test" |
| 19 | + assert webhook.custom_headers[0]["value"] == "header" |
14 | 20 |
|
15 | 21 | test_client.webhook.delete( |
16 | 22 | webhook.id |
@@ -42,11 +48,17 @@ def test_webhook_all(page_size, test_client): |
42 | 48 |
|
43 | 49 |
|
44 | 50 | @pytest.mark.vcr() |
45 | | -def test_webhook_update(webhook_url, test_client): |
| 51 | +def test_webhook_update(webhook_url, webhook_secret, webhook_custom_headers, test_client): |
46 | 52 | webhook = test_client.webhook.create(url=webhook_url) |
47 | | - test_client.webhook.update(webhook.id) |
| 53 | + updated_webhook = test_client.webhook.update( |
| 54 | + webhook.id, |
| 55 | + webhook_secret=webhook_secret, |
| 56 | + custom_headers=webhook_custom_headers, |
| 57 | + ) |
48 | 58 |
|
49 | | - assert isinstance(webhook, Webhook) |
| 59 | + assert isinstance(updated_webhook, Webhook) |
| 60 | + assert updated_webhook.custom_headers[0]["name"] == "test" |
| 61 | + assert updated_webhook.custom_headers[0]["value"] == "header" |
50 | 62 |
|
51 | 63 | test_client.webhook.delete( |
52 | 64 | webhook.id |
|
0 commit comments