From 88c3c986da5bd1550db9f4b5e59491068e4e1896 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 18 Feb 2018 16:47:45 +0000 Subject: md_tw.py: Rename TWRenderer._tw_set_options method. * md_tw.py (TWRenderer)[_tw_set_options]: Remove method. [tw_set]: New method. * tests/test_md_tw.py(TestTWRenderer) [test_tw_set_options_with_valid_opts]: Remove test. [test_tw_set_with_valid_opts]: Add test. [test_tw_set_options_with_invalid_opts]: Remove test. [test_tw_set_with_invalid_opts]: Add test. --- md_tw.py | 4 ++-- tests/test_md_tw.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/md_tw.py b/md_tw.py index acde6a5..4b833ba 100644 --- a/md_tw.py +++ b/md_tw.py @@ -225,7 +225,7 @@ class TWRenderer(mistune.Renderer): ) - def _tw_set_options(self, **kwargs): + def tw_set(self, **kwargs): """ Set options for the local textwrap.TextWrapper instance. """ @@ -248,7 +248,7 @@ class TWRenderer(mistune.Renderer): def _tw_fill(self, text, **kwargs): """Wrap text. """ - self._tw_set_options(**kwargs) + self.tw_set(**kwargs) return self.tw.fill(text) diff --git a/tests/test_md_tw.py b/tests/test_md_tw.py index 780c0c7..ccdd016 100644 --- a/tests/test_md_tw.py +++ b/tests/test_md_tw.py @@ -757,11 +757,11 @@ class TestTWRenderer(object): nose_tools.assert_equal(renderer.tw.width, 80) - def test_tw_set_options_with_valid_opts(self): + def test_tw_set_with_valid_opts(self): renderer = TWRenderer() # Set valid options - renderer._tw_set_options( + renderer.tw_set( width=80, initial_indent='> ', subsequent_indent=' ', @@ -774,11 +774,11 @@ class TestTWRenderer(object): nose_tools.assert_equal(renderer.tw.drop_whitespace, False) - def test_tw_set_options_with_invalid_opts(self): + def test_tw_set_with_invalid_opts(self): renderer = TWRenderer() # Set invalid options - renderer._tw_set_options( + renderer.tw_set( erase_bumps=True, destroy_ampersands=False, end_width='வருகிறேன்', -- cgit v1.2.3