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

Function test_user

tests/test_permission.py:138–150  ·  view source on GitHub ↗
(
    app: App, session_ids: tuple[str, ...], session_id: str | None, expected: bool
)

Source from the content-addressed store, hash-verified

136 ],
137)
138async def test_user(
139 app: App, session_ids: tuple[str, ...], session_id: str | None, expected: bool
140):
141 dependent = next(iter(USER(*session_ids).checkers))
142 checker = dependent.call
143
144 assert isinstance(checker, User)
145
146 event = make_fake_event(_session_id=session_id)()
147
148 async with app.test_api() as ctx:
149 bot = ctx.create_bot()
150 assert await dependent(bot=bot, event=event) == expected

Callers

nothing calls this directly

Calls 2

USERFunction · 0.90
make_fake_eventFunction · 0.90

Tested by

no test coverage detected