mirror of
https://github.com/arcan1s/ahriman.git
synced 2026-10-13 08:40:29 +00:00
type: update to the typed aiohttp release
This commit is contained in:
1 parent
18d17d4d52
commit
0991dbb59c
4 files changed
+15
-6
No files matched your search
@@ -9,6 +9,7 @@ from unittest.mock import AsyncMock, call as MockCall
|
||||
|
||||
from ahriman.core.auth import Auth
|
||||
from ahriman.core.configuration import Configuration
|
||||
from ahriman.models.build_status import BuildStatusEnum
|
||||
from ahriman.models.user import User
|
||||
from ahriman.models.user_access import UserAccess
|
||||
from ahriman.web.middlewares.auth_handler import _AuthorizationPolicy, _auth_handler, _cookie_secret_key, setup_auth
|
||||
@@ -39,6 +40,9 @@ async def test_permits(authorization_policy: _AuthorizationPolicy, user: User) -
|
||||
|
||||
assert await authorization_policy.permits(user.username, user.access, "/endpoint")
|
||||
assert not await authorization_policy.permits("somerandomname", user.access, "/endpoint")
|
||||
assert not await authorization_policy.permits(None, user.access, "/endpoint")
|
||||
assert not await authorization_policy.permits(user.username, "random", "/endpoint")
|
||||
assert not await authorization_policy.permits(None, BuildStatusEnum.Building, "/endpoint")
|
||||
|
||||
authorization_policy.validator.verify_access.assert_has_calls([
|
||||
MockCall(user.username, user.access, "/endpoint"),
|
||||
|
||||
Reference in new issue
Block a user