diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2023-02-15 22:05:29 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2023-02-15 22:05:29 -0600 |
commit | 30ccf03fa849b5c6b550ab85aabce860a16b16cf (patch) | |
tree | a847fe8767547e91bdd076b01d3b4bb54e13ecbc /tests/test_pymdvar.py | |
parent | 26dabc676ac74812f2dbcfaf0e2b7c5b21e804c9 (diff) |
add more testing and fix small bugs
Diffstat (limited to 'tests/test_pymdvar.py')
-rw-r--r-- | tests/test_pymdvar.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_pymdvar.py b/tests/test_pymdvar.py index 2e305ec..69ffe56 100644 --- a/tests/test_pymdvar.py +++ b/tests/test_pymdvar.py @@ -14,7 +14,10 @@ def test_empty_input(): @pytest.mark.parametrize('in_str, exp_str', [ ('foo bar', '<p>foo bar</p>'), ('foo *test* bar', '<p>foo <em>test</em> bar</p>'), - ('foo **test** bar', '<p>foo <strong>test</strong> bar</p>') + ('foo **test** bar', '<p>foo <strong>test</strong> bar</p>'), + ('foo $test bar', '<p>foo $test bar</p>'), + ('foo *${test* bar', '<p>foo <em>${test</em> bar</p>'), + ('foo **$test}** bar', '<p>foo <strong>$test}</strong> bar</p>'), ]) def test_non_replacements(in_str, exp_str): out_str = markdown(in_str, extensions=[VariableExtension()]) @@ -24,7 +27,9 @@ def test_non_replacements(in_str, exp_str): @pytest.mark.parametrize('in_str, exp_str', [ ('foo ${test} bar', '<p>foo value bar</p>'), ('foo *${test}* bar', '<p>foo <em>value</em> bar</p>'), - ('foo **${test}** bar', '<p>foo <strong>value</strong> bar</p>') + ('foo **${test}** bar', '<p>foo <strong>value</strong> bar</p>'), + ('foo [link](${test}/a.html) bar', '<p>foo <a href="value/a.html">link</a> bar</p>'), + ('foo ![image](${test}/a.jpg) bar', '<p>foo <img alt="image" src="value/a.jpg" /> bar</p>'), ]) def test_simple_replacements(in_str, exp_str): out_str = markdown(in_str, extensions=[VariableExtension(variables={'test':'value'})]) |