1- """
2- SettingsService Integration Tests (Private Key Assertion)
3-
4- This suite verifies the Zitadel SettingsService API's general settings
5- endpoint works when authenticating via a private key assertion:
6-
7- 1. Retrieve general settings successfully with a valid private key
8- 2. Expect an ApiException when using an invalid private key path
9-
10- Each test instantiates a new client to ensure a clean, stateless call.
11- """
12-
131import os
142import pathlib
153
@@ -36,20 +24,39 @@ def key_file(tmp_path: pathlib.Path) -> str:
3624 return str (file_path )
3725
3826
39- def test_retrieves_general_settings_with_valid_private_key (base_url : str , key_file : str ) -> None :
40- """Retrieves general settings successfully with a valid private key."""
41- client = zitadel .Zitadel .with_private_key (
42- base_url ,
43- key_file ,
44- )
45- client .settings .settings_service_get_general_settings ()
27+ class TestUsePrivateKeySpec :
28+ """
29+ SettingsService Integration Tests (Private Key Assertion)
4630
31+ This suite verifies the Zitadel SettingsService API's general settings
32+ endpoint works when authenticating via a private key assertion:
4733
48- def test_raises_api_exception_with_invalid_private_key (key_file : str ) -> None :
49- """Raises ApiException when using an invalid private key path."""
50- client = zitadel .Zitadel .with_private_key (
51- "https://zitadel.cloud" ,
52- key_file ,
53- )
54- with pytest .raises (OpenApiError ):
34+ 1. Retrieve general settings successfully with a valid private key
35+ 2. Expect an ApiException when using an invalid private key path
36+
37+ Each test instantiates a new client to ensure a clean, stateless call.
38+ """
39+
40+ def test_retrieves_general_settings_with_valid_private_key (
41+ self ,
42+ base_url : str ,
43+ key_file : str ,
44+ ) -> None :
45+ """Retrieves general settings successfully with a valid private key."""
46+ client = zitadel .Zitadel .with_private_key (
47+ base_url ,
48+ key_file ,
49+ )
5550 client .settings .settings_service_get_general_settings ()
51+
52+ def test_raises_api_exception_with_invalid_private_key (
53+ self ,
54+ key_file : str ,
55+ ) -> None :
56+ """Raises ApiException when using an invalid private key path."""
57+ client = zitadel .Zitadel .with_private_key (
58+ "https://zitadel.cloud" ,
59+ key_file ,
60+ )
61+ with pytest .raises (OpenApiError ):
62+ client .settings .settings_service_get_general_settings ()
0 commit comments