summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index d57328d..d508bef 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -429,6 +429,7 @@ verify(unicode('hello','utf-8') == u'hello')
verify(unicode('hello','utf8') == u'hello')
verify(unicode('hello','latin-1') == u'hello')
+# Compatibility to str():
class String:
x = ''
def __str__(self):
@@ -444,6 +445,10 @@ o.x = u'abc'
verify(unicode(o) == u'abc')
verify(str(o) == 'abc')
+for obj in (123, 123.45, 123L):
+ verify(unicode(obj) == unicode(str(obj)))
+
+# Error handling
try:
u'Andr\202 x'.encode('ascii')
u'Andr\202 x'.encode('ascii','strict')