From 60053691081b345ece6084bf1000473a4aff0565 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 28 Jun 2022 21:38:47 +0200 Subject: [PATCH] Added some test cases for the MarkdownLinktreeProcessor --- CHANGELOG.md | 1 + tests/test_markdown.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952ecf4..17ef628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * respective default answers will be written to config if user provided no answer * added tests for quickstart +* Added some test cases for the MarkdownLinktreeProcessor ## [1.3.1] - 2022-06-10 diff --git a/tests/test_markdown.py b/tests/test_markdown.py index 602824e..9103ec1 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -32,6 +32,20 @@ def test_convert_markdown_links(input_, expected): assert expected in html +@pytest.mark.parametrize("input_, expected", [ + # scheme + ('[test](https://)', 'https://'), + # netloc + ('[test](//test.md)', '//test.md'), + # no path + ('[test]()', ''), +]) +def test_dont_convert_normal_links(input_, expected): + md = markdown_factory() + html, _ = convert_markdown(md, input_) + assert expected in html + + @pytest.mark.parametrize("input_, expected", [ ('foo: bar', {'foo': 'bar'}), ('foo: those are several words', {'foo': 'those are several words'}),