From 572189a38a4792a7b990aa2a493be8be13b027e5 Mon Sep 17 00:00:00 2001 From: Pauline Ribeyre <4224001+paulineribeyre@users.noreply.github.com> Date: Wed, 9 Oct 2024 16:26:02 -0500 Subject: [PATCH] add test case --- python/tests/arborist/test_urls.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/tests/arborist/test_urls.py b/python/tests/arborist/test_urls.py index ab78a33..036885d 100644 --- a/python/tests/arborist/test_urls.py +++ b/python/tests/arborist/test_urls.py @@ -248,6 +248,10 @@ async def test_can_user_access_resources( {"service": "service2", "method": "read"}, {"service": "service1", "method": "write"}, ], + "/d": [ + {"service": "service1", "method": "write"}, + {"service": "service1", "method": "read"}, + ], }, ) } @@ -258,7 +262,7 @@ async def test_can_user_access_resources( username="test-user", service="service1", method="read", - resource_paths=["/a", "/a/b", "/c"], + resource_paths=["/a", "/a/b", "/c", "/d"], ) if use_async: res = await res @@ -266,4 +270,5 @@ async def test_can_user_access_resources( # /a: right service and method => True # /a/b: nested under /a which is accessible => True # /c: right service, wrong method and right method, wrong service => False - assert res == {"/a": True, "/a/b": True, "/c": False} + # /d: one of the permissions is the right service and method => True + assert res == {"/a": True, "/a/b": True, "/c": False, "/d": True}