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:
Egor 2020-05-31 17:49:33 +03:00 committed by GitHub
parent cb0a898487
commit 70767111c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -457,3 +457,8 @@ WEBHOOK_INFO = {
"has_custom_certificate": False,
"pending_update_count": 0,
}
REPLY_KEYBOARD_MARKUP = {
"keyboard": [[{"text": "something here"}]],
"resize_keyboard": True,
}

View 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