mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Move packages
This commit is contained in:
parent
70088cdd65
commit
4f12b6792f
109 changed files with 364 additions and 384 deletions
27
tests/test_handler/test_inline_query.py
Normal file
27
tests/test_handler/test_inline_query.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
from aiogram.handler import InlineQueryHandler
|
||||
from aiogram.types import InlineQuery, User
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
class TestCallbackQueryHandler:
|
||||
async def test_attributes_aliases(self):
|
||||
event = InlineQuery(
|
||||
id="query",
|
||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||
query="query",
|
||||
offset="0",
|
||||
)
|
||||
|
||||
class MyHandler(InlineQueryHandler):
|
||||
async def handle(self) -> Any:
|
||||
assert self.event == event
|
||||
assert self.from_user == self.event.from_user
|
||||
assert self.query == self.event.query
|
||||
return True
|
||||
|
||||
assert await MyHandler(event)
|
||||
Loading…
Add table
Add a link
Reference in a new issue