From 7a470d57c8caf8df0ef56cdd7c5daf5ba4cb079e Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:10:33 +0200 Subject: [PATCH] Add a Test Case for `MenuButton` (#4363) --- tests/test_menubutton.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_menubutton.py b/tests/test_menubutton.py index bb859a206..48c9c30c9 100644 --- a/tests/test_menubutton.py +++ b/tests/test_menubutton.py @@ -136,6 +136,13 @@ class TestMenuButtonWithoutRequest(TestMenuButtonselfBase): json_dict = {"type": "invalid", "text": self.text, "web_app": self.web_app.to_dict()} assert type(scope_class.de_json(json_dict, bot)) is scope_class + def test_de_json_empty_data(self, scope_class): + if scope_class in (MenuButtonWebApp,): + pytest.skip( + "This test is not relevant for subclasses that have more attributes than just type" + ) + assert isinstance(scope_class.de_json({}, None), scope_class) + def test_to_dict(self, menu_button): menu_button_dict = menu_button.to_dict()