mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fix tests
This commit is contained in:
parent
741fc4a557
commit
717a400a11
@ -92,7 +92,7 @@ class TestPermissionRoutes:
|
||||
|
||||
response = await client.get(app.url_path_for("get_permissions"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(response.json()) == 10 # 5 default permissions + 5 custom permissions
|
||||
assert len(response.json()) == 11 # 6 default permissions + 5 custom permissions
|
||||
|
||||
async def test_update_permission(self, app: FastAPI, client: AsyncClient, db_session: AsyncSession, project: Project) -> None:
|
||||
|
||||
@ -132,4 +132,4 @@ class TestPermissionRoutes:
|
||||
|
||||
rbac_repo = RbacRepository(db_session)
|
||||
permissions_in_db = await rbac_repo.get_permissions()
|
||||
assert len(permissions_in_db) == 9 # 5 default permissions + 4 custom permissions
|
||||
assert len(permissions_in_db) == 10 # 6 default permissions + 4 custom permissions
|
||||
|
@ -142,7 +142,7 @@ class TestRolesPermissionsRoutes:
|
||||
)
|
||||
assert response.status_code == status.HTTP_204_NO_CONTENT
|
||||
permissions = await rbac_repo.get_role_permissions(role_in_db.role_id)
|
||||
assert len(permissions) == 5 # 4 default permissions + 1 custom permission
|
||||
assert len(permissions) == 6 # 5 default permissions + 1 custom permission
|
||||
|
||||
async def test_get_role_permissions(
|
||||
self,
|
||||
@ -160,7 +160,7 @@ class TestRolesPermissionsRoutes:
|
||||
role_id=role_in_db.role_id)
|
||||
)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert len(response.json()) == 5 # 4 default permissions + 1 custom permission
|
||||
assert len(response.json()) == 6 # 5 default permissions + 1 custom permission
|
||||
|
||||
async def test_remove_role_from_group(
|
||||
self,
|
||||
@ -182,4 +182,4 @@ class TestRolesPermissionsRoutes:
|
||||
)
|
||||
assert response.status_code == status.HTTP_204_NO_CONTENT
|
||||
permissions = await rbac_repo.get_role_permissions(role_in_db.role_id)
|
||||
assert len(permissions) == 4 # 4 default permissions
|
||||
assert len(permissions) == 5 # 5 default permissions
|
||||
|
Loading…
Reference in New Issue
Block a user