summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-06-14 00:04:46 (GMT)
committerGuido van Rossum <guido@python.org>2007-06-14 00:04:46 (GMT)
commitf903f00ee211529811001ad0c35764efe68ca039 (patch)
treef6e8cab1e1d7124e92adb1ba2fac26c3ae075a6d /Lib/test
parent8518bdc382e509a6cf49c393886ea3dc6e7b577a (diff)
downloadcpython-f903f00ee211529811001ad0c35764efe68ca039.zip
cpython-f903f00ee211529811001ad0c35764efe68ca039.tar.gz
cpython-f903f00ee211529811001ad0c35764efe68ca039.tar.bz2
Fix some tests by deleting stuff.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/string_tests.py52
-rw-r--r--Lib/test/test_str.py1
-rw-r--r--Lib/test/test_unicode.py2
-rwxr-xr-xLib/test/test_userstring.py2
4 files changed, 1 insertions, 56 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 0ce212c..fe159b6 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -1096,58 +1096,6 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(TypeError, S, 'rpartition', None)
-class MixinStrStringUserStringTest:
- # Additional tests for 8bit strings, i.e. str, UserString and
- # the string module
-
- def test_maketrans(self):
- self.assertEqual(
- ''.join(map(chr, range(256))).replace('abc', 'xyz'),
- string.maketrans('abc', 'xyz')
- )
- self.assertRaises(ValueError, string.maketrans, 'abc', 'xyzw')
-
- def test_translate(self):
- table = string.maketrans('abc', 'xyz')
- self.checkequal('xyzxyz', 'xyzabcdef', 'translate', table, 'def')
-
- table = string.maketrans('a', 'A')
- self.checkequal('Abc', 'abc', 'translate', table)
- self.checkequal('xyz', 'xyz', 'translate', table)
- self.checkequal('yz', 'xyz', 'translate', table, 'x')
- self.checkequal('yx', 'zyzzx', 'translate', None, 'z')
- self.checkequal('zyzzx', 'zyzzx', 'translate', None, '')
- self.checkequal('zyzzx', 'zyzzx', 'translate', None)
- self.checkraises(ValueError, 'xyz', 'translate', 'too short', 'strip')
- self.checkraises(ValueError, 'xyz', 'translate', 'too short')
-
-
-class MixinStrUserStringTest:
- # Additional tests that only work with
- # 8bit compatible object, i.e. str and UserString
-
- 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)
-
-
class MixinStrUnicodeTest:
# Additional tests that only work with str and unicode.
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
index 2ef01f0..ad118d6 100644
--- a/Lib/test/test_str.py
+++ b/Lib/test/test_str.py
@@ -8,7 +8,6 @@ from test import test_support, string_tests
class StrTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
- string_tests.MixinStrUserStringTest,
string_tests.MixinStrUnicodeTest,
):
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index fbad984..11c7328 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -791,7 +791,7 @@ class UnicodeTest(
# to take a 64-bit long, this test should apply to all platforms.
if sys.maxint > (1 << 32) or struct.calcsize('P') != 4:
return
- self.assertRaises(OverflowError, u't\tt\t'.expandtabs, sys.maxint)
+ self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxint)
def test_main():
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index 53114db..ec0f1a9 100755
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -10,8 +10,6 @@ from UserString import UserString, MutableString
class UserStringTest(
string_tests.CommonTest,
string_tests.MixinStrUnicodeUserStringTest,
- string_tests.MixinStrStringUserStringTest,
- string_tests.MixinStrUserStringTest
):
type2test = UserString