Skip to content

Commit

Permalink
whoami viewer-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiucco committed Nov 25, 2024
1 parent 4d155e2 commit d1c34fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures_testserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def testserver(tester, tmpdir_factory, request):
"FRACTAL_RUNNER_WORKING_BASE_DIR="
f"{FRACTAL_RUNNER_WORKING_BASE_DIR}\n"
"FRACTAL_LOGGING_LEVEL=0\n"
"FRACTAL_VIEWER_AUTHORIZATION_SCHEME=viewer-paths\n"
)
_run_command(
f"dropdb --username=postgres --host localhost --if-exists {DB_NAME}"
Expand Down
6 changes: 6 additions & 0 deletions tests/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@ def test_group_commands(
viewer_paths_post_pach = res_post_patch.data.pop("viewer_paths")
assert viewer_paths_post_pach == ["/a/b", "/c/d"]
assert res_post_patch.data == res_pre_patch.data

# Test `whoami --viewer-paths`
invoke_as_superuser(f"group add-user {group1_id} {superuser_id}")
assert "viewer_paths" not in superuser
res = invoke_as_superuser("user whoami --viewer-paths")
assert set(res.data.get("viewer_paths")) == {"/a/b", "/c/d"}

0 comments on commit d1c34fc

Please sign in to comment.