|
1 | 1 | from itertools import product |
2 | | -from pathlib import Path |
| 2 | +import os.path |
| 3 | +import unittest |
3 | 4 |
|
4 | 5 | from defusedxml import ElementTree as ET |
5 | 6 | import pytest |
|
10 | 11 |
|
11 | 12 | from . import _utils |
12 | 13 |
|
| 14 | +from . import _utils |
| 15 | + |
13 | 16 | TEST_ASSET_DIR = Path(__file__).parent / "assets" |
14 | 17 |
|
15 | 18 | GET_XML = TEST_ASSET_DIR / "site_get.xml" |
@@ -270,40 +273,16 @@ def test_encrypt(server: TSC.Server) -> None: |
270 | 273 | server.sites.encrypt_extracts("0626857c-1def-4503-a7d8-7907c3ff9d9f") |
271 | 274 |
|
272 | 275 |
|
273 | | -def test_recrypt(server: TSC.Server) -> None: |
274 | | - with requests_mock.mock() as m: |
275 | | - m.post(server.sites.baseurl + "/0626857c-1def-4503-a7d8-7907c3ff9d9f/reencrypt-extracts", status_code=200) |
276 | | - server.sites.re_encrypt_extracts("0626857c-1def-4503-a7d8-7907c3ff9d9f") |
277 | | - |
278 | | - |
279 | | -def test_decrypt(server: TSC.Server) -> None: |
280 | | - with requests_mock.mock() as m: |
281 | | - m.post(server.sites.baseurl + "/0626857c-1def-4503-a7d8-7907c3ff9d9f/decrypt-extracts", status_code=200) |
282 | | - server.sites.decrypt_extracts("0626857c-1def-4503-a7d8-7907c3ff9d9f") |
283 | | - |
284 | | - |
285 | | -def test_list_auth_configurations(server: TSC.Server) -> None: |
286 | | - server.version = "3.24" |
287 | | - response_xml = SITE_AUTH_CONFIG_XML.read_text() |
288 | | - |
289 | | - assert server.sites.baseurl == server.sites.baseurl |
290 | | - |
291 | | - with requests_mock.mock() as m: |
292 | | - m.get(f"{server.sites.baseurl}/{server.site_id}/site-auth-configurations", status_code=200, text=response_xml) |
293 | | - configs = server.sites.list_auth_configurations() |
294 | | - |
295 | | - assert len(configs) == 2, "Expected 2 auth configurations" |
296 | | - |
297 | | - assert configs[0].auth_setting == "OIDC" |
298 | | - assert configs[0].enabled |
299 | | - assert configs[0].idp_configuration_id == "00000000-0000-0000-0000-000000000000" |
300 | | - assert configs[0].idp_configuration_name == "Initial Salesforce" |
301 | | - assert configs[0].known_provider_alias == "Salesforce" |
302 | | - assert configs[1].auth_setting == "SAML" |
303 | | - assert configs[1].enabled |
304 | | - assert configs[1].idp_configuration_id == "11111111-1111-1111-1111-111111111111" |
305 | | - assert configs[1].idp_configuration_name == "Initial SAML" |
306 | | - assert configs[1].known_provider_alias is None |
| 276 | + assert configs[0].auth_setting == "OIDC" |
| 277 | + assert configs[0].enabled |
| 278 | + assert configs[0].idp_configuration_id == "00000000-0000-0000-0000-000000000000" |
| 279 | + assert configs[0].idp_configuration_name == "Initial Salesforce" |
| 280 | + assert configs[0].known_provider_alias == "Salesforce" |
| 281 | + assert configs[1].auth_setting == "SAML" |
| 282 | + assert configs[1].enabled |
| 283 | + assert configs[1].idp_configuration_id == "11111111-1111-1111-1111-111111111111" |
| 284 | + assert configs[1].idp_configuration_name == "Initial SAML" |
| 285 | + assert configs[1].known_provider_alias is None |
307 | 286 |
|
308 | 287 |
|
309 | 288 | @pytest.mark.parametrize("capture", [True, False, None]) |
|
0 commit comments