diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2013-09-25 14:43:18 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2013-09-25 14:43:18 +0400 |
commit | 7d10f204203397c3ab34c20014fef55e3d8ba16d (patch) | |
tree | 048a2f7b0a4bdde45ee99b0e3796111126c665cb /tests/test_apis.py | |
parent | ed399ac3da4dddfd676bedada42a3aa4d4d80e1e (diff) | |
download | markdown-7d10f204203397c3ab34c20014fef55e3d8ba16d.tar.gz markdown-7d10f204203397c3ab34c20014fef55e3d8ba16d.tar.bz2 markdown-7d10f204203397c3ab34c20014fef55e3d8ba16d.zip |
Add tests for the previous two commits
Diffstat (limited to 'tests/test_apis.py')
-rw-r--r-- | tests/test_apis.py | 13 |
1 files changed, 13 insertions, 0 deletions
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') |