From 3545139dd7330b6648acbf61f677144be18237ca Mon Sep 17 00:00:00 2001 From: Poolitzer <25934244+Poolitzer@users.noreply.github.com> Date: Sat, 12 Oct 2019 13:40:42 -0700 Subject: [PATCH] adding to_dict test (#1544) fixes #1541 --- tests/test_bot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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):