Skip to content

Commit f347a2e

Browse files
jorwoodsjacalata
authored andcommitted
feat: enable toggling attribute capture for a site (#1619)
* feat: enable toggling attribute capture for a site According to https://help.tableau.com/current/api/embedding_api/en-us/docs/embedding_api_user_attributes.html#:~:text=For%20security%20purposes%2C%20user%20attributes,a%20site%20admin%20(on%20Tableau setting this site setting to `true` is required to enable use of user attributes with Tableau Server and embedding workflows. * chore: fix mypy error --------- Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
1 parent 6c60a97 commit f347a2e

File tree

1 file changed

+14
-35
lines changed

1 file changed

+14
-35
lines changed

test/test_site.py

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from itertools import product
2-
from pathlib import Path
2+
import os.path
3+
import unittest
34

45
from defusedxml import ElementTree as ET
56
import pytest
@@ -10,6 +11,8 @@
1011

1112
from . import _utils
1213

14+
from . import _utils
15+
1316
TEST_ASSET_DIR = Path(__file__).parent / "assets"
1417

1518
GET_XML = TEST_ASSET_DIR / "site_get.xml"
@@ -270,40 +273,16 @@ def test_encrypt(server: TSC.Server) -> None:
270273
server.sites.encrypt_extracts("0626857c-1def-4503-a7d8-7907c3ff9d9f")
271274

272275

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
307286

308287

309288
@pytest.mark.parametrize("capture", [True, False, None])

0 commit comments

Comments
 (0)