MCPcopy
hub / github.com/nonebot/nonebot2 / test_superuser

Function test_superuser

tests/test_permission.py:116–126  ·  view source on GitHub ↗
(app: App, type: str, user_id: str, expected: bool)

Source from the content-addressed store, hash-verified

114 ],
115)
116async def test_superuser(app: App, type: str, user_id: str, expected: bool):
117 dependent = next(iter(SUPERUSER.checkers))
118 checker = dependent.call
119
120 assert isinstance(checker, SuperUser)
121
122 event = make_fake_event(_type=type, _user_id=user_id)()
123
124 async with app.test_api() as ctx:
125 bot = ctx.create_bot()
126 assert await dependent(bot=bot, event=event) == expected
127
128
129@pytest.mark.anyio

Callers

nothing calls this directly

Calls 1

make_fake_eventFunction · 0.90

Tested by

no test coverage detected