Skip to content

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.

3 participants