diff options
author | rsiddharth <s@ricketyspace.net> | 2017-02-19 01:47:54 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2017-02-19 01:47:54 +0000 |
commit | 74b4642a96ebbb4b8f6860abb2e782f72f2fc2af (patch) | |
tree | 83db9af698f268df69763e1ef743e138e461f622 /tests/test_mdl_style.py | |
parent | fb0a03dfabb29dae899c7d2f1dc94ff38a3240c6 (diff) |
Add initial version the script.
* markdown_link_style/_version.py (__version__): Update version.
* markdown_link_style/logging.py: New module
* mdl_style.py (logger): Add variable.
(LSBlockLexer, LSInlineLexer, LSRenderer, LSMarkdown)
(LinkStyler): Add classes.
(_mdl_stylize, _get_args): Add functions.
(main): Update function.
* tests/__init__.py: Add file.
* tests/data/autolink_00-expected.md: Add file.
* tests/data/autolink_00.md: Add file.
* tests/data/footnote_link_style_00-expected.md: Add file.
* tests/data/footnote_link_style_00.md: Add file.
* tests/data/inline_link_style_00-expected.md: Add file.
* tests/data/inline_link_style_00.md: Add file.
* tests/test_mdl_style.py (TestMdlStyle): Remove class.
(TestLSRendererIL, TestLSRendererFN): Add classes.
Diffstat (limited to 'tests/test_mdl_style.py')
-rw-r--r-- | tests/test_mdl_style.py | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/tests/test_mdl_style.py b/tests/test_mdl_style.py index 487ff3a..07f9480 100644 --- a/tests/test_mdl_style.py +++ b/tests/test_mdl_style.py @@ -18,14 +18,52 @@ # along with markdown-link-style (see COPYING). If not, see # <http://www.gnu.org/licenses/>. +from mistune import Renderer, Markdown from nose.tools import * +from pkg_resources import resource_string from mdl_style import * -class TestMdlStyle(object): + +def _get_data(f): + rs = resource_string(__name__, '/'.join(['data', f])) + return rs.decode() + +class TestLSRendererIL(object): + """Test class for mdl_style.LSRenderer inline link style. + + """ + + def setup(self): + self.md = LSMarkdown(link_style='inline') + + 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_footnote_to_inline_style_conversion_00(self): + d = _get_data('inline_link_style_00.md') + expected_result = _get_data('inline_link_style_00-expected.md') + assert_equal(self.md(d), expected_result) + + def teardown(self): + pass + + +class TestLSRendererFN(object): + """Test class for mdl_style.LSRenderer footnote link style. + + """ def setup(self): - print('running setup...') + self.md = LSMarkdown(link_style='footnote') + + 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), d_expected) def teardown(self): - print('running teardown...') + pass |