Exemplo n.º 1
0
 def comment_has_units(self, comment):
     logger.debug('comment_has_units(comment={!r})'.format(comment.id))
     return any(Unit.find_units(comment.body))
Exemplo n.º 2
0
def test_text_detection(text, expected_units):
    """Make sure we detect all mentioned units anywhere in a text."""
    found_units = list(Unit.find_units(text))
    assert found_units == expected_units