Browse Source

chore: linting

pull/685/head
Richard Nemeth 4 weeks ago
parent
commit
5e9d4b7054
No known key found for this signature in database GPG Key ID: 21C39470DF3DEC39
  1. 64
      tests/test_keycloak_admin.py

64
tests/test_keycloak_admin.py

@ -1447,17 +1447,27 @@ def test_clients(admin: KeycloakAdmin, realm: str) -> None:
] ]
admin.import_client_authz_config(client_id=auth_client_id, payload=authz_config) admin.import_client_authz_config(client_id=auth_client_id, payload=authz_config)
exported = admin.get_client_authz_settings(client_id=auth_client_id) exported = admin.get_client_authz_settings(client_id=auth_client_id)
assert len([
resource
for resource in exported["resources"]
if resource["name"] == "test-import-resource"]
) == 1
assert len([
resource
for resource in exported["policies"]
if resource["name"] == "test-import-policy"]
) == 1
assert (
len(
[
resource
for resource in exported["resources"]
if resource["name"] == "test-import-resource"
]
)
== 1
)
assert (
len(
[
resource
for resource in exported["policies"]
if resource["name"] == "test-import-policy"
]
)
== 1
)
# Test delete client # Test delete client
res = admin.delete_client(client_id=auth_client_id) res = admin.delete_client(client_id=auth_client_id)
@ -5080,17 +5090,27 @@ async def test_a_clients(admin: KeycloakAdmin, realm: str) -> None:
] ]
await admin.a_import_client_authz_config(client_id=auth_client_id, payload=authz_config) await admin.a_import_client_authz_config(client_id=auth_client_id, payload=authz_config)
exported = await admin.a_get_client_authz_settings(client_id=auth_client_id) exported = await admin.a_get_client_authz_settings(client_id=auth_client_id)
assert len([
resource
for resource in exported["resources"]
if resource["name"] == "test-import-resource"]
) == 1
assert len([
resource
for resource in exported["policies"]
if resource["name"] == "test-import-policy"]
) == 1
assert (
len(
[
resource
for resource in exported["resources"]
if resource["name"] == "test-import-resource"
]
)
== 1
)
assert (
len(
[
resource
for resource in exported["policies"]
if resource["name"] == "test-import-policy"
]
)
== 1
)
# Test delete client # Test delete client
res = await admin.a_delete_client(client_id=auth_client_id) res = await admin.a_delete_client(client_id=auth_client_id)

Loading…
Cancel
Save