mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +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"))
|
response = await client.get(app.url_path_for("get_permissions"))
|
||||||
assert response.status_code == status.HTTP_200_OK
|
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:
|
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)
|
rbac_repo = RbacRepository(db_session)
|
||||||
permissions_in_db = await rbac_repo.get_permissions()
|
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
|
assert response.status_code == status.HTTP_204_NO_CONTENT
|
||||||
permissions = await rbac_repo.get_role_permissions(role_in_db.role_id)
|
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(
|
async def test_get_role_permissions(
|
||||||
self,
|
self,
|
||||||
@ -160,7 +160,7 @@ class TestRolesPermissionsRoutes:
|
|||||||
role_id=role_in_db.role_id)
|
role_id=role_in_db.role_id)
|
||||||
)
|
)
|
||||||
assert response.status_code == status.HTTP_200_OK
|
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(
|
async def test_remove_role_from_group(
|
||||||
self,
|
self,
|
||||||
@ -182,4 +182,4 @@ class TestRolesPermissionsRoutes:
|
|||||||
)
|
)
|
||||||
assert response.status_code == status.HTTP_204_NO_CONTENT
|
assert response.status_code == status.HTTP_204_NO_CONTENT
|
||||||
permissions = await rbac_repo.get_role_permissions(role_in_db.role_id)
|
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