summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
commitef87d6ed94780fe00250a551031023aeb2898365 (patch)
tree1f8989aaaec7ec5f8b2f26498317f2022bf85531 /Lib/test/test_array.py
parent572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (diff)
downloadcpython-ef87d6ed94780fe00250a551031023aeb2898365.zip
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.gz
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.bz2
Rip out all the u"..." literals and calls to unicode().
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 34b573f..b845570 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -747,7 +747,7 @@ class CharacterTest(StringTest):
def test_nounicode(self):
a = array.array(self.typecode, self.example)
- self.assertRaises(ValueError, a.fromunicode, unicode(''))
+ self.assertRaises(ValueError, a.fromunicode, str(''))
self.assertRaises(ValueError, a.tounicode)
tests.append(CharacterTest)
@@ -755,27 +755,27 @@ tests.append(CharacterTest)
if test_support.have_unicode:
class UnicodeTest(StringTest):
typecode = 'u'
- example = unicode(r'\x01\u263a\x00\ufeff', 'unicode-escape')
- smallerexample = unicode(r'\x01\u263a\x00\ufefe', 'unicode-escape')
- biggerexample = unicode(r'\x01\u263a\x01\ufeff', 'unicode-escape')
- outside = unicode('\x33')
+ example = str(r'\x01\u263a\x00\ufeff', 'unicode-escape')
+ smallerexample = str(r'\x01\u263a\x00\ufefe', 'unicode-escape')
+ biggerexample = str(r'\x01\u263a\x01\ufeff', 'unicode-escape')
+ outside = str('\x33')
minitemsize = 2
def test_unicode(self):
- self.assertRaises(TypeError, array.array, 'b', unicode('foo', 'ascii'))
+ self.assertRaises(TypeError, array.array, 'b', str('foo', 'ascii'))
- a = array.array('u', unicode(r'\xa0\xc2\u1234', 'unicode-escape'))
- a.fromunicode(unicode(' ', 'ascii'))
- a.fromunicode(unicode('', 'ascii'))
- a.fromunicode(unicode('', 'ascii'))
- a.fromunicode(unicode(r'\x11abc\xff\u1234', 'unicode-escape'))
+ a = array.array('u', str(r'\xa0\xc2\u1234', 'unicode-escape'))
+ a.fromunicode(str(' ', 'ascii'))
+ a.fromunicode(str('', 'ascii'))
+ a.fromunicode(str('', 'ascii'))
+ a.fromunicode(str(r'\x11abc\xff\u1234', 'unicode-escape'))
s = a.tounicode()
self.assertEqual(
s,
- unicode(r'\xa0\xc2\u1234 \x11abc\xff\u1234', 'unicode-escape')
+ str(r'\xa0\xc2\u1234 \x11abc\xff\u1234', 'unicode-escape')
)
- s = unicode(r'\x00="\'a\\b\x80\xff\u0000\u0001\u1234', 'unicode-escape')
+ s = str(r'\x00="\'a\\b\x80\xff\u0000\u0001\u1234', 'unicode-escape')
a = array.array('u', s)
self.assertEqual(
repr(a),