diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-08 14:30:53 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-08 14:30:53 (GMT) |
commit | 9b775535f828bedc30f3f52a04afec049b6aa25a (patch) | |
tree | 12b9a0e80636c157457d827a7436e77d843e03b3 /Lib/test/string_tests.py | |
parent | 0157ebe999e951a4a3a5296586b08f4f96384bb3 (diff) | |
download | cpython-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.py | 39 |
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: |