diff options
author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2013-01-01 20:00:21 +0000 |
---|---|---|
committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2013-01-01 20:00:21 +0000 |
commit | 92c57ee16d2234f2e00e6f4737ce1f3569c4c7e1 (patch) | |
tree | 0afd17563c08a3995a28d3e6d6c51650b2859f2e /test | |
parent | a5619c66b083ead857f2d7adc29d3cd2d45c61f4 (diff) | |
download | docutils-92c57ee16d2234f2e00e6f4737ce1f3569c4c7e1.tar.gz |
Unify/simplify type testing in "validate_*_list".
Circumvent the problem that the value may be "unicode" or "str" by testing
for "not a list".
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7584 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_settings.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/test_settings.py b/test/test_settings.py index d7c111c0f..bde80328f 100755 --- a/test/test_settings.py +++ b/test/test_settings.py @@ -198,9 +198,11 @@ class HelperFunctionsTests(unittest.TestCase): def test_validate_colon_separated_string_list(self): tests = ( (u'a', ['a',] ), - (u'a:12', ['a', '12'] ), + ('a', ['a',] ), + (u'a:b', ['a', 'b'] ), + ('a:b', ['a', 'b'] ), ([u'a',], ['a',] ), - # TODO ("u'a',", ['a',] ), AttributeError: 'str' object has no attribute 'pop' + ([u'a', u'b:c'], ['a', 'b', 'c'] ), ) for t in tests: self.assertEqual( @@ -211,9 +213,12 @@ class HelperFunctionsTests(unittest.TestCase): def test_validate_comma_separated_list(self): tests = ( (u'a', ['a',] ), - (u'a,12', ['a', '12'] ), + ('a', ['a',] ), + (u'a,b', ['a', 'b'] ), + ('a,b', ['a', 'b'] ), ([u'a',], ['a',] ), - ('a,', ['a',] ), # in python3 this is unicode too + ([u'a', u'b,c'], ['a', 'b', 'c'] ), + (['a', 'b,c'], ['a', 'b', 'c'] ), ) for t in tests: self.assertEqual( |