aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_apis.py20
-rw-r--r--tests/test_extensions.py16
2 files changed, 15 insertions, 21 deletions
diff --git a/tests/test_apis.py b/tests/test_apis.py
index 010bf70..b19db62 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -303,14 +303,24 @@ class TestErrors(unittest.TestCase):
self.assertRaises(NotImplementedError,
markdown.Markdown, extensions=['fake_c'])
- def testDotSyntaxExtention(self):
- """ Test that dot syntax imports properly (not using mdx_). """
- _create_fake_extension(name='fake_d', use_old_style=False)
- self.assertRaises(NotImplementedError,
+ def testMdxExtention(self):
+ """ Test that appending mdx_ raises a PendingDeprecationWarning. """
+ _create_fake_extension(name='fake_d', use_old_style=True)
+ self.assertRaises(PendingDeprecationWarning,
markdown.Markdown, extensions=['fake_d'])
+ def testShortNameExtention(self):
+ """ Test that using a short name raises a PendingDeprecationWarning. """
+ self.assertRaises(PendingDeprecationWarning,
+ markdown.Markdown, extensions=['footnotes'])
+
+ def testStringConfigExtention(self):
+ """ Test that passing configs to an Extension in the name raises a PendingDeprecationWarning. """
+ self.assertRaises(PendingDeprecationWarning,
+ markdown.Markdown, extensions=['markdown.extension.footnotes(PLACE_MARKER=FOO)'])
+
-def _create_fake_extension(name, has_factory_func=True, is_wrong_type=False, use_old_style=True):
+def _create_fake_extension(name, has_factory_func=True, is_wrong_type=False, use_old_style=False):
""" Create a fake extension module for testing. """
if use_old_style:
mod_name = '_'.join(['mdx', name])
diff --git a/tests/test_extensions.py b/tests/test_extensions.py
index a7be627..a21fd94 100644
--- a/tests/test_extensions.py
+++ b/tests/test_extensions.py
@@ -47,22 +47,6 @@ class TestExtensionClass(unittest.TestCase):
# self.ext.setConfig('bad', 'baz) ==> KeyError
self.assertRaises(KeyError, self.ext.setConfig, 'bad', 'baz')
- def testConfigAsArgListOnInit(self):
- ext = self.ExtKlass([('foo', 'baz'), ('bar', 'blah')])
- self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'})
-
- def testConfigAsArgDictOnInit(self):
- ext = self.ExtKlass({'foo': 'baz', 'bar': 'blah', 'bar': 'blah'})
- self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'})
-
- def testConfigAsKwargListOnInit(self):
- ext = self.ExtKlass(configs=[('foo', 'baz'), ('bar', 'blah')])
- self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'})
-
- def testConfigAsKwargDictOnInit(self):
- ext = self.ExtKlass(configs={'foo': 'baz', 'bar': 'blah'})
- self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'})
-
def testConfigAsKwargsOnInit(self):
ext = self.ExtKlass(foo='baz', bar='blah')
self.assertEqual(ext.getConfigs(), {'foo': 'baz', 'bar': 'blah'})