mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-14 02:52:12 +00:00
Add tests for: message, chat, user, game, animation, document, photo
This commit is contained in:
parent
917c808b3d
commit
02596057a0
10 changed files with 309 additions and 24 deletions
29
tests/test_game.py
Normal file
29
tests/test_game.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
from aiogram import types
|
||||
from .dataset import GAME
|
||||
|
||||
game = types.Game(**GAME)
|
||||
|
||||
def test_export():
|
||||
exported = game.to_python()
|
||||
assert isinstance(exported, dict)
|
||||
assert exported == GAME
|
||||
|
||||
|
||||
def test_title():
|
||||
assert isinstance(game.title, str)
|
||||
assert game.title == GAME['title']
|
||||
|
||||
|
||||
def test_description():
|
||||
assert isinstance(game.description, str)
|
||||
assert game.description == GAME['description']
|
||||
|
||||
|
||||
def test_photo():
|
||||
assert isinstance(game.photo, list)
|
||||
assert len(game.photo) == len(GAME['photo'])
|
||||
assert all(map(lambda t: isinstance(t, types.PhotoSize), game.photo))
|
||||
|
||||
|
||||
def test_animation():
|
||||
assert isinstance(game.animation, types.Animation)
|
||||
Loading…
Add table
Add a link
Reference in a new issue