[Python-3000-checkins] r55275 - python/branches/py3k-struni/Lib/test/test_unicode.py

walter.doerwald python-3000-checkins at python.org
Fri May 11 21:57:11 CEST 2007


Author: walter.doerwald
Date: Fri May 11 21:57:05 2007
New Revision: 55275

Modified:
   python/branches/py3k-struni/Lib/test/test_unicode.py
Log:
There's no longer a u prefix for unicode objects
=> drop it.

Fix idna test (encode() returns bytes now).


Modified: python/branches/py3k-struni/Lib/test/test_unicode.py
==============================================================================
--- python/branches/py3k-struni/Lib/test/test_unicode.py	(original)
+++ python/branches/py3k-struni/Lib/test/test_unicode.py	Fri May 11 21:57:05 2007
@@ -55,9 +55,9 @@
     def test_literals(self):
         self.assertEqual('\xff', '\u00ff')
         self.assertEqual('\uffff', '\U0000ffff')
-        self.assertRaises(UnicodeError, eval, 'u\'\\Ufffffffe\'')
-        self.assertRaises(UnicodeError, eval, 'u\'\\Uffffffff\'')
-        self.assertRaises(UnicodeError, eval, 'u\'\\U%08x\'' % 0x110000)
+        self.assertRaises(UnicodeError, eval, '\'\\Ufffffffe\'')
+        self.assertRaises(UnicodeError, eval, '\'\\Uffffffff\'')
+        self.assertRaises(UnicodeError, eval, '\'\\U%08x\'' % 0x110000)
 
     def test_repr(self):
         if not sys.platform.startswith('java'):
@@ -541,7 +541,7 @@
 
     def test_codecs_idna(self):
         # Test whether trailing dot is preserved
-        self.assertEqual("www.python.org.".encode("idna"), "www.python.org.")
+        self.assertEqual("www.python.org.".encode("idna"), b"www.python.org.")
 
     def test_codecs_errors(self):
         # Error handling (encoding)
@@ -622,8 +622,8 @@
         # This excludes surrogates: in the full range, there would be
         # a surrogate pair (\udbff\udc00), which gets converted back
         # to a non-BMP character (\U0010fc00)
-        u = u''.join(map(chr, list(range(0,0xd800)) +
-                              list(range(0xe000,0x10000))))
+        u = ''.join(map(chr, list(range(0,0xd800)) +
+                             list(range(0xe000,0x10000))))
         for encoding in ('utf-8',):
             self.assertEqual(str(u.encode(encoding),encoding), u)
 


More information about the Python-3000-checkins mailing list