Debian Codegraph @

tests/wire/test_keys_encryption.py

raw symbols SCIP
1 from .conftest import get_client, verify_request_count
2
3
4 def test_keys_encryption_list_() -> None:
5 """Test list endpoint with WireMock"""
6 test_id = "keys.encryption.list_.0"
7 client = get_client(test_id)
8 client.keys.encryption.list(
9 page=1,
10 per_page=1,
11 include_totals=True,
12 )
13 verify_request_count(
14 test_id, "GET", "/keys/encryption", {"page": "1", "per_page": "1", "include_totals": "true"}, 1
15 )
16
17
18 def test_keys_encryption_create() -> None:
19 """Test create endpoint with WireMock"""
20 test_id = "keys.encryption.create.0"
21 client = get_client(test_id)
22 client.keys.encryption.create(
23 type="customer-provided-root-key",
24 )
25 verify_request_count(test_id, "POST", "/keys/encryption", None, 1)
26
27
28 def test_keys_encryption_rekey() -> None:
29 """Test rekey endpoint with WireMock"""
30 test_id = "keys.encryption.rekey.0"
31 client = get_client(test_id)
32 client.keys.encryption.rekey()
33 verify_request_count(test_id, "POST", "/keys/encryption/rekey", None, 1)
34
35
36 def test_keys_encryption_get() -> None:
37 """Test get endpoint with WireMock"""
38 test_id = "keys.encryption.get.0"
39 client = get_client(test_id)
40 client.keys.encryption.get(
41 kid="kid",
42 )
43 verify_request_count(test_id, "GET", "/keys/encryption/kid", None, 1)
44
45
46 def test_keys_encryption_import_() -> None:
47 """Test import endpoint with WireMock"""
48 test_id = "keys.encryption.import_.0"
49 client = get_client(test_id)
50 client.keys.encryption.import_(
51 kid="kid",
52 wrapped_key="wrapped_key",
53 )
54 verify_request_count(test_id, "POST", "/keys/encryption/kid", None, 1)
55
56
57 def test_keys_encryption_delete() -> None:
58 """Test delete endpoint with WireMock"""
59 test_id = "keys.encryption.delete.0"
60 client = get_client(test_id)
61 client.keys.encryption.delete(
62 kid="kid",
63 )
64 verify_request_count(test_id, "DELETE", "/keys/encryption/kid", None, 1)
65
66
67 def test_keys_encryption_create_public_wrapping_key() -> None:
68 """Test createPublicWrappingKey endpoint with WireMock"""
69 test_id = "keys.encryption.create_public_wrapping_key.0"
70 client = get_client(test_id)
71 client.keys.encryption.create_public_wrapping_key(
72 kid="kid",
73 )
74 verify_request_count(test_id, "POST", "/keys/encryption/kid/wrapping-key", None, 1)