mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: add support init fields from parent object in KeyboardButton (#344)
* fix: add support init fields from parent object in KeyboardButton * fix: add tests
This commit is contained in:
parent
cb0a898487
commit
70767111c4
3 changed files with 21 additions and 2 deletions
|
|
@ -457,3 +457,8 @@ WEBHOOK_INFO = {
|
|||
"has_custom_certificate": False,
|
||||
"pending_update_count": 0,
|
||||
}
|
||||
|
||||
REPLY_KEYBOARD_MARKUP = {
|
||||
"keyboard": [[{"text": "something here"}]],
|
||||
"resize_keyboard": True,
|
||||
}
|
||||
|
|
|
|||
12
tests/types/test_reply_keyboard.py
Normal file
12
tests/types/test_reply_keyboard.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from aiogram import types
|
||||
from .dataset import REPLY_KEYBOARD_MARKUP
|
||||
|
||||
reply_keyboard = types.ReplyKeyboardMarkup(**REPLY_KEYBOARD_MARKUP)
|
||||
|
||||
|
||||
def test_serialize():
|
||||
assert reply_keyboard.to_python() == REPLY_KEYBOARD_MARKUP
|
||||
|
||||
|
||||
def test_deserialize():
|
||||
assert reply_keyboard.to_object(reply_keyboard.to_python()) == reply_keyboard
|
||||
Loading…
Add table
Add a link
Reference in a new issue