adding to_dict test (#1544)

fixes #1541
This commit is contained in:
Poolitzer 2019-10-12 13:40:42 -07:00 committed by Noam Meltzer
parent d0c27e2d46
commit 3545139dd7

View file

@ -89,6 +89,18 @@ class TestBot(object):
assert get_me_bot.last_name == bot.last_name
assert get_me_bot.name == bot.name
@flaky(3, 1)
@pytest.mark.timeout(10)
def test_to_dict(self, bot):
to_dict_bot = bot.to_dict()
assert isinstance(to_dict_bot, dict)
assert to_dict_bot["id"] == bot.id
assert to_dict_bot["username"] == bot.username
assert to_dict_bot["first_name"] == bot.first_name
if bot.last_name:
assert to_dict_bot["last_name"] == bot.last_name
@flaky(3, 1)
@pytest.mark.timeout(10)
def test_forward_message(self, bot, chat_id, message):