mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Add a Test Case for MenuButton
(#4363)
This commit is contained in:
parent
1714bfd8f6
commit
7a470d57c8
1 changed files with 7 additions and 0 deletions
|
@ -136,6 +136,13 @@ class TestMenuButtonWithoutRequest(TestMenuButtonselfBase):
|
||||||
json_dict = {"type": "invalid", "text": self.text, "web_app": self.web_app.to_dict()}
|
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
|
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):
|
def test_to_dict(self, menu_button):
|
||||||
menu_button_dict = menu_button.to_dict()
|
menu_button_dict = menu_button.to_dict()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue