Switch to pytest
This commit is contained in:
25
tests/test_args.py
Normal file
25
tests/test_args.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Test whitelisting/blacklisting of specific tags.
|
||||
|
||||
"""
|
||||
from markdownify import markdownify as md
|
||||
|
||||
|
||||
def test_strip():
|
||||
text = md('<a href="https://github.com/matthewwithanm">Some Text</a>', strip=['a'])
|
||||
assert text == 'Some Text'
|
||||
|
||||
|
||||
def test_do_not_strip():
|
||||
text = md('<a href="https://github.com/matthewwithanm">Some Text</a>', strip=[])
|
||||
assert text == '[Some Text](https://github.com/matthewwithanm)'
|
||||
|
||||
|
||||
def test_convert():
|
||||
text = md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=['a'])
|
||||
assert text == '[Some Text](https://github.com/matthewwithanm)'
|
||||
|
||||
|
||||
def test_do_not_convert():
|
||||
text = md('<a href="https://github.com/matthewwithanm">Some Text</a>', convert=[])
|
||||
assert text == 'Some Text'
|
||||
Reference in New Issue
Block a user