From d3b7762f52800efa6b931614181fc6c8690eeb27 Mon Sep 17 00:00:00 2001 From: Simone Ferrigno Date: Fri, 4 Aug 2023 10:55:45 +0200 Subject: [PATCH] test: trying to support old and new Keycloak versions for test_auth_flows & test_authentication_configs test: trying to support old and new Keycloak versions for test_auth_flows & test_authentication_configs https://github.com/keycloak/keycloak/issues/20497 --- tests/test_keycloak_admin.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_keycloak_admin.py b/tests/test_keycloak_admin.py index 0951db3..e78f51b 100644 --- a/tests/test_keycloak_admin.py +++ b/tests/test_keycloak_admin.py @@ -1869,7 +1869,7 @@ def test_auth_flows(admin: KeycloakAdmin, realm: str): admin.realm_name = realm res = admin.get_authentication_flows() - assert len(res) == 8, res + assert len(res) == 8 or len(res) == 7, res assert set(res[0].keys()) == { "alias", "authenticationExecutions", @@ -1888,6 +1888,14 @@ def test_auth_flows(admin: KeycloakAdmin, realm: str): "direct grant", "first broker login", "clients", + } or {x["alias"] for x in res} == { + "reset credentials", + "browser", + "registration", + "docker auth", + "direct grant", + "first broker login", + "clients", } with pytest.raises(KeycloakGetError) as err: @@ -1904,7 +1912,7 @@ def test_auth_flows(admin: KeycloakAdmin, realm: str): res = admin.copy_authentication_flow(payload={"newName": "test-browser"}, flow_alias="browser") assert res == b"", res - assert len(admin.get_authentication_flows()) == 9 + assert len(admin.get_authentication_flows()) == 9 or len(admin.get_authentication_flows()) == 8 # Test create res = admin.create_authentication_flow( @@ -2023,7 +2031,7 @@ def test_authentication_configs(admin: KeycloakAdmin, realm: str): # Test list of auth providers res = admin.get_authenticator_providers() - assert len(res) == 38 + assert len(res) == 38 or len(res) == 35 res = admin.get_authenticator_provider_config_description(provider_id="auth-cookie") assert res == {