Skip to content
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

Fix in telegram.Message #1042

Merged
merged 2 commits into from
Mar 16, 2018
Merged

Fix in telegram.Message #1042

merged 2 commits into from
Mar 16, 2018

Conversation

Eldinnie
Copy link
Member

The _parse_(html|markdown) methods now properly return None on an empty Message.text or an empty Message.caption

The `_parse_(html|markdown)` methods now properly return `None` on an empty `Message.text` or an empty `Message.caption`
def test_text_html_empty(self, message):
message.text = None
message.caption = "test"
assert not message.text_html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps change to assert message.text_html is None ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for the other tests of course

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could, but why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it would properly test the feature. We don't want to allow empty strings, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why not, actually I was think of doing:

if not message_text:
  return message_text

@jh0ker jh0ker merged commit e182046 into master Mar 16, 2018
@Eldinnie Eldinnie deleted the Fix_parse_html-markdown branch April 17, 2018 06:57
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants