aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_apis.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-04-28 20:40:05 -0400
committerWaylan Limberg <waylan@gmail.com>2011-04-28 20:40:05 -0400
commitf87713c85d8c895dc15cf78c99673efce371a056 (patch)
tree7a999baf4e5e1583935dc5efb298d8d10091d315 /tests/test_apis.py
parentd2bb675211be2470a34cb62e36016c5171e6a20a (diff)
downloadmarkdown-f87713c85d8c895dc15cf78c99673efce371a056.tar.gz
markdown-f87713c85d8c895dc15cf78c99673efce371a056.tar.bz2
markdown-f87713c85d8c895dc15cf78c99673efce371a056.zip
Update tests for logging changes. No more message function.
Diffstat (limited to 'tests/test_apis.py')
-rw-r--r--tests/test_apis.py27
1 files changed, 6 insertions, 21 deletions
diff --git a/tests/test_apis.py b/tests/test_apis.py
index ebbc24f..eecfbf6 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -13,8 +13,6 @@ import os
import sys
import types
import markdown
-from markdown.md_logging import MarkdownException, MarkdownWarning
-from logging import DEBUG, INFO, WARN, ERROR, CRITICAL
import warnings
class TestMarkdownBasics(unittest.TestCase):
@@ -226,47 +224,34 @@ class TestErrors(unittest.TestCase):
# Reset warning behavior back to default
warnings.simplefilter('default')
- def testMessageWarn(self):
- """ Test message WARN. """
- self.assertRaises(MarkdownWarning, markdown.md_logging.message,
- WARN, 'This should raise a MardownWarning')
-
- def testMessageError(self):
- """ Test message ERROR. """
- self.assertRaises(MarkdownException, markdown.md_logging.message,
- ERROR, 'This should raise a MarkdownException')
-
def testNonUnicodeSource(self):
""" Test falure on non-unicode source text. """
source = "foo".encode('utf-16')
- self.assertRaises(MarkdownException, markdown.markdown, source)
+ self.assertRaises(UnicodeDecodeError, markdown.markdown, source)
def testBadOutputFormat(self):
""" Test failure on bad output_format. """
- self.assertRaises(MarkdownException,
- markdown.Markdown, output_format='invalid')
+ self.assertRaises(KeyError, markdown.Markdown, output_format='invalid')
def testLoadExtensionFailure(self):
""" Test failure of an extension to load. """
- self.assertRaises(MarkdownWarning,
+ self.assertRaises(ValueError,
markdown.Markdown, extensions=['non_existant_ext'])
def testLoadBadExtension(self):
""" Test loading of an Extension with no makeExtension function. """
_create_fake_extension(name='fake', has_factory_func=False)
- self.assertRaises(MarkdownException,
- markdown.Markdown, extensions=['fake'])
+ self.assertRaises(ValueError, markdown.Markdown, extensions=['fake'])
def testNonExtension(self):
""" Test loading a non Extension object as an extension. """
_create_fake_extension(name='fake', is_wrong_type=True)
- self.assertRaises(MarkdownException,
- markdown.Markdown, extensions=['fake'])
+ self.assertRaises(ValueError, markdown.Markdown, extensions=['fake'])
def testBaseExtention(self):
""" Test that the base Extension class will raise NotImplemented. """
_create_fake_extension(name='fake')
- self.assertRaises(MarkdownException,
+ self.assertRaises(NotImplementedError,
markdown.Markdown, extensions=['fake'])