aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2014-07-11 20:06:57 -0400
committerWaylan Limberg <waylan@gmail.com>2014-07-11 20:06:57 -0400
commitdf170411f369d20f85a4718698cdff100271b587 (patch)
treef9b90d5dbfe87742b0eaf87a1147038f75f3fbc5
parent498776588990bbf151248584e6c23ca1935bed98 (diff)
downloadmarkdown-df170411f369d20f85a4718698cdff100271b587.tar.gz
markdown-df170411f369d20f85a4718698cdff100271b587.tar.bz2
markdown-df170411f369d20f85a4718698cdff100271b587.zip
Add tests of markdown.extensions.Extension
-rw-r--r--tests/test_extensions.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index d33feec..8cd6c31 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -11,6 +11,29 @@ from __future__ import unicode_literals
import unittest
import markdown
+class TestExtensionClass(unittest.TestCase):
+ """ Test markdown.extensions.Extension. """
+
+ def setUp(self):
+ self.ext = markdown.extensions.Extension(configs={'foo':['bar', 'Description of foo']})
+
+ def testGetConfig(self):
+ self.assertEqual(self.ext.getConfig('foo'), 'bar')
+
+ def testGetConfigDefault(self):
+ self.assertEqual(self.ext.getConfig('baz', default='missing'), 'missing')
+
+ def testGetConfigs(self):
+ self.assertEqual(self.ext.getConfigs(), {'foo': 'bar'})
+
+ def testGetConfigInfo(self):
+ self.assertEqual(self.ext.getConfigInfo(), [('foo', 'Description of foo')])
+
+ def testSetConfig(self):
+ self.ext.setConfig('foo', 'baz')
+ self.assertEqual(self.ext.getConfigs(), {'foo': 'baz'})
+
+
class TestAbbr(unittest.TestCase):
""" Test abbr extension. """