diff MoinMoin/_tests/test_wikiutil.py @ 2528:1ae621d83c5b

fix arg parser bug, test for this bug
author Johannes Berg <johannes AT sipsolutions DOT net>
date Mon, 23 Jul 2007 11:37:05 +0200
parents 68496057ee03
children 116ab80df98b
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Mon Jul 23 11:36:37 2007 +0200
+++ b/MoinMoin/_tests/test_wikiutil.py	Mon Jul 23 11:37:05 2007 +0200
@@ -266,6 +266,7 @@
                                                     u'e': u'a,b,c,d'}, [])),
                   (u'd = "", e = ',           ([], {u'd': u'', u'e': None},
                                                [])),
+                  (u'd=""',                   ([], {u'd': u''}, [])),
                   (u'd = "", e = ""',         ([], {u'd': u'', u'e': u''},
                                                [])),
                   # no, None as key isn't accepted
@@ -281,6 +282,14 @@
         for args, expected in tests:
             result = wikiutil.parse_quoted_separated(args)
             assert expected == result
+            for val in result[0]:
+                assert val is None or isinstance(val, unicode)
+            for val in result[1].keys():
+                assert val is None or isinstance(val, unicode)
+            for val in result[1].values():
+                assert val is None or isinstance(val, unicode)
+            for val in result[2]:
+                assert val is None or isinstance(val, unicode)
 
     def testLimited(self):
         tests = [
@@ -293,6 +302,14 @@
         for args, expected in tests:
             result = wikiutil.parse_quoted_separated(args, seplimit=1)
             assert expected == result
+            for val in result[0]:
+                assert val is None or isinstance(val, unicode)
+            for val in result[1].keys():
+                assert val is None or isinstance(val, unicode)
+            for val in result[1].values():
+                assert val is None or isinstance(val, unicode)
+            for val in result[2]:
+                assert val is None or isinstance(val, unicode)
 
     def testNoNameValue(self):
         abcd = [u'a', u'b', u'c', u'd']
@@ -313,6 +330,8 @@
         for args, expected in tests:
             result = wikiutil.parse_quoted_separated(args, name_value=False)
             assert expected == result
+            for val in result:
+                assert val is None or isinstance(val, unicode)
 
 
 class TestArgGetters: