def test_excerpt_default_length(): assert markdown_excerpt(u'a' * 300) == u'a' * 300 assert markdown_excerpt(u'a' * 301) == u'a' * 299 + u'…'
def test_excerpt(target, expected): assert markdown_excerpt(target, length=30) == expected