aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/extensions/test.cfg4
-rw-r--r--tests/extensions/toc_nested.html8
-rw-r--r--tests/extensions/toc_nested2.html8
-rw-r--r--tests/test_apis.py13
4 files changed, 23 insertions, 10 deletions
diff --git a/tests/extensions/test.cfg b/tests/extensions/test.cfg
index 1a13b1c..494d79b 100644
--- a/tests/extensions/test.cfg
+++ b/tests/extensions/test.cfg
@@ -16,10 +16,10 @@ extensions=toc
extensions=toc
[toc_nested]
-extensions=toc
+extensions=toc(permalink=1)
[toc_nested2]
-extensions=toc
+extensions=toc(permalink=[link])
[wikilinks]
extensions=wikilinks
diff --git a/tests/extensions/toc_nested.html b/tests/extensions/toc_nested.html
index 3703e51..27af9df 100644
--- a/tests/extensions/toc_nested.html
+++ b/tests/extensions/toc_nested.html
@@ -1,7 +1,7 @@
-<h1 id="header-a">Header A</h1>
-<h2 id="header-1">Header 1</h2>
-<h3 id="header-i">Header i</h3>
-<h1 id="header-b">Header <em>B</em></h1>
+<h1 id="header-a">Header A<a class="headerlink" href="#header-a" title="Permanent link">&para;</a></h1>
+<h2 id="header-1">Header 1<a class="headerlink" href="#header-1" title="Permanent link">&para;</a></h2>
+<h3 id="header-i">Header i<a class="headerlink" href="#header-i" title="Permanent link">&para;</a></h3>
+<h1 id="header-b">Header <em>B</em><a class="headerlink" href="#header-b" title="Permanent link">&para;</a></h1>
<div class="toc">
<ul>
<li><a href="#header-a">Header A</a><ul>
diff --git a/tests/extensions/toc_nested2.html b/tests/extensions/toc_nested2.html
index bf87716..2d8fa2d 100644
--- a/tests/extensions/toc_nested2.html
+++ b/tests/extensions/toc_nested2.html
@@ -8,7 +8,7 @@
<li><a href="#header-3_1">Header 3</a></li>
</ul>
</div>
-<h3 id="start-with-header-other-than-one">Start with header other than one.</h3>
-<h3 id="header-3">Header 3</h3>
-<h4 id="header-4">Header 4</h4>
-<h3 id="header-3_1">Header 3</h3> \ No newline at end of file
+<h3 id="start-with-header-other-than-one">Start with header other than one.<a class="headerlink" href="#start-with-header-other-than-one" title="Permanent link">[link]</a></h3>
+<h3 id="header-3">Header 3<a class="headerlink" href="#header-3" title="Permanent link">[link]</a></h3>
+<h4 id="header-4">Header 4<a class="headerlink" href="#header-4" title="Permanent link">[link]</a></h4>
+<h3 id="header-3_1">Header 3<a class="headerlink" href="#header-3_1" title="Permanent link">[link]</a></h3> \ No newline at end of file
diff --git a/tests/test_apis.py b/tests/test_apis.py
index bbe165d..a7d6685 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -420,3 +420,16 @@ class testAtomicString(unittest.TestCase):
'<div><p>*some* <span>*more* <span>*text* <span>*here*</span> '
'*to*</span> *test*</span> *with*</p></div>')
+class TestConfigParsing(unittest.TestCase):
+ def assertParses(self, value, result):
+ self.assertIs(markdown.util.parseBoolValue(value, False), result)
+
+ def testBooleansParsing(self):
+ self.assertParses(True, True)
+ self.assertParses('novalue', None)
+ self.assertParses('yES', True)
+ self.assertParses('FALSE', False)
+ self.assertParses(0., False)
+
+ def testInvalidBooleansParsing(self):
+ self.assertRaises(ValueError, markdown.util.parseBoolValue, 'novalue')