Skip to content

Add a Test Case for MenuButton #4363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_menubutton.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ def test_de_json_subclass(self, scope_class, bot):
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()

Expand Down
Loading