diff --git a/tests/test_openbao_platform_admin_callback_prune.py b/tests/test_openbao_platform_admin_callback_prune.py index 73299e9..2efb379 100644 --- a/tests/test_openbao_platform_admin_callback_prune.py +++ b/tests/test_openbao_platform_admin_callback_prune.py @@ -24,8 +24,8 @@ def live(role): def test_prunes_only_the_two_retired_callbacks_and_keeps_settings(): - role = dict(DECLARED, allowed_redirect_uris=list(DECLARED['allowed_redirect_uris']) + list(m.RETIRED) - if not set(m.RETIRED) <= set(DECLARED['allowed_redirect_uris']) else list(DECLARED['allowed_redirect_uris'])) + # The declaration is post-prune; re-add the retired callbacks to model the pre-prune role. + role = dict(DECLARED, allowed_redirect_uris=list(DECLARED['allowed_redirect_uris']) + list(m.RETIRED)) state, writes, read, write = live(role) changed, uris = m.prune(read, write) assert changed and len(writes) == 1 @@ -50,7 +50,7 @@ def test_refuses_without_tunnel_callback(): def test_refuses_when_readback_drops_other_settings(): - role = copy.deepcopy(DECLARED) + role = dict(copy.deepcopy(DECLARED), allowed_redirect_uris=list(DECLARED['allowed_redirect_uris']) + list(m.RETIRED)) calls = iter([copy.deepcopy(role), copy.deepcopy(role), dict(copy.deepcopy(role), token_ttl=60, allowed_redirect_uris=[u for u in role['allowed_redirect_uris'] if u not in m.RETIRED])])