markdown-link-style

switch between inline and footnote link style in markdown documents.
git clone git://git.ricketyspace.net/markdown-link-style.git
Log | Files | Refs

commit 6d2d685678cb7be71ab14ebef114714ef2b03ce7
parent 2fcde808761b80577231e61f89d35e64a6c5dffb
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu, 23 Feb 2017 01:19:36 +0000

tests: Update test_mdl_style.TestLSRendererFN

* tests/data/footnote_parses_images_00-expected.md: Update file.
* tests/data/footnote_parses_images_00.md: Update file.
* tests/test_mdl_style.py
(TestLSRendererFN.test_autolink_00)
(TestLSRendererFN.test_renderer_parses_images)
(TestLSRendererFN.test_renderer_does_not_parse_link_breaks)
(TestLSRendererFN.test_renderer_does_not_parse_headers)
(TestLSRendererFN.test_renderer_does_not_parse_blockquotes)
(TestLSRendererFN.test_renderer_does_not_parse_lists)
(TestLSRendererFN.test_renderer_does_not_parse_codeblocks)
(TestLSRendererFN.test_renderer_does_not_parse_hrules)
(TestLSRendererFN.test_renderer_does_not_parse_emphasis)
(TestLSRendererFN.test_renderer_does_not_parse_code): Add test methods.

Diffstat:
tests/data/footnote_parses_images_00-expected.md | 11+++++++++++
tests/data/footnote_parses_images_00.md | 7+++++++
tests/test_mdl_style.py | 42++++++++++++++++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/tests/data/footnote_parses_images_00-expected.md b/tests/data/footnote_parses_images_00-expected.md @@ -0,0 +1,11 @@ +![IMG 00][0] + +[0]: /path/to/img-00.jpg + +![IMG 01][1] + +[1]: /path/to/img-01.jpg (IMG 01 Title) + +![IMG 02][2] + +[2]: url/to/image-02 (IMG 02 Title) diff --git a/tests/data/footnote_parses_images_00.md b/tests/data/footnote_parses_images_00.md @@ -0,0 +1,7 @@ +![IMG 00](/path/to/img-00.jpg) + +![IMG 01](/path/to/img-01.jpg "IMG 01 Title") + +![IMG 02][img02-id] + +[img02-id]: url/to/image-02 "IMG 02 Title" diff --git a/tests/test_mdl_style.py b/tests/test_mdl_style.py @@ -96,10 +96,52 @@ class TestLSRendererFN(object): def setup(self): self.md = LSMarkdown(link_style='footnote') + def test_autolink_00(self): + d = _get_data('autolink_00.md') + d_expected = _get_data('autolink_00-expected.md') + assert_equals(self.md(d), d_expected) + def test_link_inline_to_footnote_style_conversion_00(self): d = _get_data('footnote_link_style_00.md') expected_result = _get_data('footnote_link_style_00-expected.md') assert_equal(self.md(d), expected_result) + def test_renderer_parses_images(self): + d = _get_data('footnote_parses_images_00.md') + expected_result = _get_data('footnote_parses_images_00-expected.md') + assert_equal(self.md(d), expected_result) + + def test_renderer_does_not_parse_link_breaks(self): + d = _get_data('does_not_parse_link_breaks_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_headers(self): + d = _get_data('does_not_parse_headers_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_blockquotes(self): + d = _get_data('does_not_parse_blockquotes_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_lists(self): + d = _get_data('does_not_parse_lists_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_codeblocks(self): + d = _get_data('does_not_parse_codeblocks_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_hrules(self): + d = _get_data('does_not_parse_hrules_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_emphasis(self): + d = _get_data('does_not_parse_emphasis_00.md') + assert_equal(self.md(d), d) + + def test_renderer_does_not_parse_code(self): + d = _get_data('does_not_parse_code_00.md') + assert_equal(self.md(d), d) + def teardown(self): pass