]> granicus.if.org Git - python/commitdiff
#9161: add test for the bug fixed by r82581.
authorR David Murray <rdmurray@bitdance.com>
Tue, 14 Aug 2012 02:04:30 +0000 (22:04 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 14 Aug 2012 02:04:30 +0000 (22:04 -0400)
Patch by Michael Johnson.

Lib/test/test_optparse.py

index f86ea0176ac340aa10319b1088f52a6fbb0c9a53..59f752e937159452b1e039569430ae9374f9ddc5 100644 (file)
@@ -769,6 +769,13 @@ class TestStandard(BaseTest):
         self.assertParseFail(["-test"],
                              "no such option: -e")
 
+    def test_flag_accepts_unicode(self):
+        try:
+            self.parser.add_option(u"-u", u"--unicode")
+            self.parser.parse_args()
+        except TypeError:
+            self.fail("Failed parsing flag passed to add_option() as unicode.")
+
 class TestBool(BaseTest):
     def setUp(self):
         options = [make_option("-v",