diff options
author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-12-31 11:57:12 +0000 |
---|---|---|
committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2012-12-31 11:57:12 +0000 |
commit | ca9bd31e3512b64f1edfe4dd33b3e939fb69a107 (patch) | |
tree | 533008d6a0fdf470c64c3ad2711318e559049240 /test | |
parent | 1c9c5ee630efd16d2f6b89af67a3b5b3adb0af2d (diff) | |
download | docutils-ca9bd31e3512b64f1edfe4dd33b3e939fb69a107.tar.gz |
Add tests for frontend.validate_comma_separated_list and frontend.validate_colon_separated_string_list
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7581 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_settings.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_settings.py b/test/test_settings.py index 8aaafc6f6..fa81f4307 100755 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -195,5 +195,30 @@ class HelperFunctionsTests(unittest.TestCase): # not touched, because key not in keys: self.assertEqual(pathdict['spam'], u'spam') + def test_validate_colon_separated_string_list(self): + tests = ( + (u'a', ['a',] ), + (u'a:12', ['a', '12'] ), + ([u'a',], ['a',] ), + # TODO ("u'a',", ['a',] ), AttributeError: 'str' object has no attribute 'pop' + ) + for t in tests: + self.assertEqual( + frontend.validate_colon_separated_string_list(None, t[0], None), + t[1]) + + + def test_validate_comma_separated_list(self): + tests = ( + (u'a', ['a',] ), + (u'a,12', ['a', '12'] ), + ([u'a',], ['a',] ), + # TODO ("u'a',", ['a',] ), AttributeError: 'str' object has no attribute 'pop' + ) + for t in tests: + self.assertEqual( + frontend.validate_comma_separated_list(None, t[0], None), + t[1]) + if __name__ == '__main__': unittest.main() |