mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Add test_update
This commit is contained in:
parent
f5a2d19e79
commit
ed1e80c76c
1 changed files with 20 additions and 0 deletions
20
tests/test_update.py
Normal file
20
tests/test_update.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from aiogram import types
|
||||
from .dataset import UPDATE
|
||||
|
||||
update = types.Update(**UPDATE)
|
||||
|
||||
|
||||
def test_export():
|
||||
exported = update.to_python()
|
||||
assert isinstance(exported, dict)
|
||||
assert exported == UPDATE
|
||||
|
||||
|
||||
def test_update_id():
|
||||
assert isinstance(update.update_id, int)
|
||||
assert hash(update) == UPDATE['update_id']
|
||||
assert update.update_id == UPDATE['update_id']
|
||||
|
||||
|
||||
def test_message():
|
||||
assert isinstance(update.message, types.Message)
|
||||
Loading…
Add table
Add a link
Reference in a new issue