diff --git a/tests/test_bot.py b/tests/test_bot.py index b7dfb2ddc..5eb581360 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -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):