From ed661f74428670df810d4d702cd31c760693b455 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 25 Aug 2014 10:43:50 -0400 Subject: Fixed a bug in markdown.util.parseBoolValue A couple scenarios with "None" were previously not accounted for. Also updated tests which guives us 100% for markdown/util.py --- tests/test_apis.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/test_apis.py b/tests/test_apis.py index e99f606..a5e0d73 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -455,6 +455,11 @@ class TestConfigParsing(unittest.TestCase): self.assertParses('yES', True) self.assertParses('FALSE', False) self.assertParses(0., False) + self.assertParses('none', False) + + def testPreserveNone(self): + self.assertTrue(markdown.util.parseBoolValue('None', preserve_none=True) is None) + self.assertTrue(markdown.util.parseBoolValue(None, preserve_none=True) is None) def testInvalidBooleansParsing(self): self.assertRaises(ValueError, markdown.util.parseBoolValue, 'novalue') -- cgit v1.2.3