summaryrefslogtreecommitdiffstats
path: root/Lib/test/string_tests.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-08 14:30:53 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-08 14:30:53 (GMT)
commit9b775535f828bedc30f3f52a04afec049b6aa25a (patch)
tree12b9a0e80636c157457d827a7436e77d843e03b3 /Lib/test/string_tests.py
parent0157ebe999e951a4a3a5296586b08f4f96384bb3 (diff)
downloadcpython-9b775535f828bedc30f3f52a04afec049b6aa25a.zip
cpython-9b775535f828bedc30f3f52a04afec049b6aa25a.tar.gz
cpython-9b775535f828bedc30f3f52a04afec049b6aa25a.tar.bz2
Rename checks for test_support.have_unicode (we always
have unicode support now) and either drop the tests or merge them into the existing tests.
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r--Lib/test/string_tests.py39
1 files changed, 19 insertions, 20 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index d5a9a29..4dfbb1b 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -1100,27 +1100,26 @@ class MixinStrUserStringTest:
# Additional tests that only work with
# 8bit compatible object, i.e. str and UserString
- if test_support.have_unicode:
- def test_encoding_decoding(self):
- codecs = [('rot13', b'uryyb jbeyq'),
- ('base64', b'aGVsbG8gd29ybGQ=\n'),
- ('hex', b'68656c6c6f20776f726c64'),
- ('uu', b'begin 666 <data>\n+:&5L;&\\@=V]R;&0 \n \nend\n')]
- for encoding, data in codecs:
- self.checkequal(data, 'hello world', 'encode', encoding)
- self.checkequal('hello world', data, 'decode', encoding)
- # zlib is optional, so we make the test optional too...
- try:
- import zlib
- except ImportError:
- pass
- else:
- data = b'x\x9c\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\x01\x00\x1a\x0b\x04]'
- self.checkequal(data, 'hello world', 'encode', 'zlib')
- self.checkequal('hello world', data, 'decode', 'zlib')
+ def test_encoding_decoding(self):
+ codecs = [('rot13', b'uryyb jbeyq'),
+ ('base64', b'aGVsbG8gd29ybGQ=\n'),
+ ('hex', b'68656c6c6f20776f726c64'),
+ ('uu', b'begin 666 <data>\n+:&5L;&\\@=V]R;&0 \n \nend\n')]
+ for encoding, data in codecs:
+ self.checkequal(data, 'hello world', 'encode', encoding)
+ self.checkequal('hello world', data, 'decode', encoding)
+ # zlib is optional, so we make the test optional too...
+ try:
+ import zlib
+ except ImportError:
+ pass
+ else:
+ data = b'x\x9c\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\x01\x00\x1a\x0b\x04]'
+ self.checkequal(data, 'hello world', 'encode', 'zlib')
+ self.checkequal('hello world', data, 'decode', 'zlib')
- self.checkraises(TypeError, 'xyz', 'decode', 42)
- self.checkraises(TypeError, 'xyz', 'encode', 42)
+ self.checkraises(TypeError, 'xyz', 'decode', 42)
+ self.checkraises(TypeError, 'xyz', 'encode', 42)
class MixinStrUnicodeTest: