From 08a9a6425aa616fdb8b6731772dbb728564a9069 Mon Sep 17 00:00:00 2001 From: Alvaro Bartolome Date: Thu, 13 Jul 2023 16:07:36 +0200 Subject: [PATCH] fix(test): assign `workspaces` to `admin` & `annotator` only --- tests/client/sdk/v1/workspaces/test_api.py | 2 +- tests/server/api/v1/test_workspaces.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/client/sdk/v1/workspaces/test_api.py b/tests/client/sdk/v1/workspaces/test_api.py index fb57f4a3eb..c2b5c99a18 100644 --- a/tests/client/sdk/v1/workspaces/test_api.py +++ b/tests/client/sdk/v1/workspaces/test_api.py @@ -39,7 +39,7 @@ async def test_get_workspace(role: UserRole) -> None: @pytest.mark.parametrize("role", [UserRole.owner, UserRole.admin, UserRole.annotator]) async def test_list_workspaces_me(role: UserRole) -> None: workspaces = await WorkspaceFactory.create_batch(size=5) - user = await UserFactory.create(role=role, workspaces=workspaces) + user = await UserFactory.create(role=role, workspaces=workspaces if role != UserRole.owner else []) httpx_client = ArgillaSingleton.init(api_key=user.api_key).http_client.httpx diff --git a/tests/server/api/v1/test_workspaces.py b/tests/server/api/v1/test_workspaces.py index 98e11f0005..cb590eb5b3 100644 --- a/tests/server/api/v1/test_workspaces.py +++ b/tests/server/api/v1/test_workspaces.py @@ -81,7 +81,7 @@ async def test_get_workspace_with_nonexistent_workspace_id(client: TestClient, o @pytest.mark.parametrize("role", [UserRole.owner, UserRole.admin, UserRole.annotator]) async def test_list_workspaces_me(client: TestClient, role: UserRole) -> None: workspaces = await WorkspaceFactory.create_batch(size=5) - user = await UserFactory.create(role=role, workspaces=workspaces) + user = await UserFactory.create(role=role, workspaces=workspaces if role != UserRole.owner else []) response = client.get("/api/v1/me/workspaces", headers={API_KEY_HEADER_NAME: user.api_key})