Debian Codegraph @

tests/wire/test_rules.py

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