Debian Codegraph @

tests/wire/test_hooks.py

raw symbols SCIP
1 from .conftest import get_client, verify_request_count
2
3
4 def test_hooks_list_() -> None:
5 """Test list endpoint with WireMock"""
6 test_id = "hooks.list_.0"
7 client = get_client(test_id)
8 client.hooks.list(
9 page=1,
10 per_page=1,
11 include_totals=True,
12 enabled=True,
13 fields="fields",
14 trigger_id="credentials-exchange",
15 )
16 verify_request_count(
17 test_id,
18 "GET",
19 "/hooks",
20 {
21 "page": "1",
22 "per_page": "1",
23 "include_totals": "true",
24 "enabled": "true",
25 "fields": "fields",
26 "triggerId": "credentials-exchange",
27 },
28 1,
29 )
30
31
32 def test_hooks_create() -> None:
33 """Test create endpoint with WireMock"""
34 test_id = "hooks.create.0"
35 client = get_client(test_id)
36 client.hooks.create(
37 name="name",
38 script="script",
39 trigger_id="credentials-exchange",
40 )
41 verify_request_count(test_id, "POST", "/hooks", None, 1)
42
43
44 def test_hooks_get() -> None:
45 """Test get endpoint with WireMock"""
46 test_id = "hooks.get.0"
47 client = get_client(test_id)
48 client.hooks.get(
49 id="id",
50 fields="fields",
51 )
52 verify_request_count(test_id, "GET", "/hooks/id", {"fields": "fields"}, 1)
53
54
55 def test_hooks_delete() -> None:
56 """Test delete endpoint with WireMock"""
57 test_id = "hooks.delete.0"
58 client = get_client(test_id)
59 client.hooks.delete(
60 id="id",
61 )
62 verify_request_count(test_id, "DELETE", "/hooks/id", None, 1)
63
64
65 def test_hooks_update() -> None:
66 """Test update endpoint with WireMock"""
67 test_id = "hooks.update.0"
68 client = get_client(test_id)
69 client.hooks.update(
70 id="id",
71 )
72 verify_request_count(test_id, "PATCH", "/hooks/id", None, 1)