Add a Test Case for MenuButton (#4363)

This commit is contained in:
Bibo-Joshi 2024-07-10 17:10:33 +02:00 committed by GitHub
parent 1714bfd8f6
commit 7a470d57c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()