Browse Source

fix: add testcase for invalid client id

pull/399/head
hadeer_e 2 years ago
parent
commit
936ed54977
  1. 4
      tests/test_keycloak_admin.py

4
tests/test_keycloak_admin.py

@ -897,9 +897,9 @@ def test_clients(admin: KeycloakAdmin, realm: str):
with pytest.raises(KeycloakPostError) as err: with pytest.raises(KeycloakPostError) as err:
admin.create_client_authz_scopes( admin.create_client_authz_scopes(
client_id=auth_client_id, payload={"name": "test-authz-scope"}
client_id='invalid_client_id', payload={"name": "test-authz-scope"}
) )
assert err.match('409: b\'{"error":"invalid_request"')
assert err.match('404: b\'{"error":"Could not find client"')
assert admin.create_client_authz_scopes( assert admin.create_client_authz_scopes(
client_id=auth_client_id, payload={"name": "test-authz-scope"}, skip_exists=True client_id=auth_client_id, payload={"name": "test-authz-scope"}, skip_exists=True
) == {"msg": "Already exists"} ) == {"msg": "Already exists"}

Loading…
Cancel
Save