From 9756cb9f6014347179a9acf54a739aad5dda0c6d Mon Sep 17 00:00:00 2001 From: Tiago Serafim Date: Wed, 19 Sep 2012 18:37:02 -0300 Subject: More tests for the extension and new tests for the RE. It's now possible to use an explicit blank title to not have the

tag with the title rendered. --- tests/test_extensions.py | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'tests/test_extensions.py') diff --git a/tests/test_extensions.py b/tests/test_extensions.py index 78c6d9d..7661347 100644 --- a/tests/test_extensions.py +++ b/tests/test_extensions.py @@ -278,25 +278,13 @@ class TestAdmonition(unittest.TestCase): def setUp(self): self.md = markdown.Markdown(extensions=['admonition']) - self.text = \ -'''!!! note - First line -!!! didyouknow "Did you know?" - Another text''' - - def testComplexSettings(self): - """ Test Complex Settings. """ - - md = markdown.Markdown( - extensions=['admonition'], - extension_configs={}, - safe_mode=True) - self.assertEqual(md.convert(self.text), - '

\n' - '

Note

\n' - '

First line

\n' - '
\n' - '
\n' - '

Did you know?

\n' - '

Another text

\n
') + def testRE(self): + RE = self.md.parser.blockprocessors['admonition'].RE + tests = [ + ('!!! note', ('note', None)), + ('!!! note "Please Note"', ('note', 'Please Note')), + ('!!! note ""', ('note', '')), + ] + for test, expected in tests: + self.assertEqual(RE.match(test).groups(), expected) -- cgit v1.2.3