summaryrefslogtreecommitdiff
path: root/Lib/test/test_unicodedata.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-07-28 07:01:43 +0000
committerMartin v. Löwis <martin@v.loewis.de>2007-07-28 07:01:43 +0000
commitbd28ca65d67afa88e2a702157eeeab0514cba9bb (patch)
tree441c52326a76592275802e5b12fce07fa88ef49d /Lib/test/test_unicodedata.py
parent0e258c5ea5c69e60eb581f3f186022a8400b8d79 (diff)
downloadcpython-git-bd28ca65d67afa88e2a702157eeeab0514cba9bb.tar.gz
Bug #1704793: Raise KeyError if unicodedata.lookup cannot
represent the result in a single character.
Diffstat (limited to 'Lib/test/test_unicodedata.py')
-rw-r--r--Lib/test/test_unicodedata.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 0023bf4406..92353f1ea9 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -6,7 +6,7 @@
"""#"
import unittest, test.test_support
-import hashlib
+import hashlib, sys
encoding = 'utf-8'
@@ -214,6 +214,10 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
count += 1
self.assert_(count >= 10) # should have tested at least the ASCII digits
+ def test_bug_1704793(self):
+ if sys.maxunicode == 65535:
+ self.assertRaises(KeyError, self.db.lookup, "GOTHIC LETTER FAIHU")
+
def test_main():
test.test_support.run_unittest(
UnicodeMiscTest,