Browse Source

test: cover the cases with unit tests

pull/316/head
Richard Nemeth 2 years ago
parent
commit
b0bc470e33
No known key found for this signature in database GPG Key ID: 21C39470DF3DEC39
  1. 4
      tests/test_keycloak_admin.py

4
tests/test_keycloak_admin.py

@ -718,7 +718,7 @@ def test_realm_roles(admin: KeycloakAdmin, realm: str):
assert members == list(), members
# Test create realm role
role_id = admin.create_realm_role(payload={"name": "test-realm-role"})
role_id = admin.create_realm_role(payload={"name": "test-realm-role"}, skip_exists=True)
assert role_id, role_id
with pytest.raises(KeycloakPostError) as err:
admin.create_realm_role(payload={"name": "test-realm-role"})
@ -865,7 +865,7 @@ def test_client_roles(admin: KeycloakAdmin, client: str):
# Test create client role
client_role_id = admin.create_client_role(
client_role_id=client, payload={"name": "client-role-test"}
client_role_id=client, payload={"name": "client-role-test"}, skip_exists=True
)
with pytest.raises(KeycloakPostError) as err:
admin.create_client_role(client_role_id=client, payload={"name": "client-role-test"})

Loading…
Cancel
Save