summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_string.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-08-26 16:53:04 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2004-08-26 16:53:04 (GMT)
commit57d88e5abd06cefcc8d52d62765c36214b1c1956 (patch)
treecdfb770ea520db3fe7d3dff2a9fd687bf7e0dcfb /Lib/test/test_string.py
parent592ef6110f8280918894372d062a20f9eb158828 (diff)
downloadcpython-57d88e5abd06cefcc8d52d62765c36214b1c1956.zip
cpython-57d88e5abd06cefcc8d52d62765c36214b1c1956.tar.gz
cpython-57d88e5abd06cefcc8d52d62765c36214b1c1956.tar.bz2
Move test_bug1001011() to string_tests.MixinStrUnicodeTest so that
it can be used for str and unicode. Drop the test for "".join([s]) is s because this is an implementation detail (and doesn't work for unicode)
Diffstat (limited to 'Lib/test/test_string.py')
-rw-r--r--Lib/test/test_string.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py
index ba9d9d3..d80c3b6 100644
--- a/Lib/test/test_string.py
+++ b/Lib/test/test_string.py
@@ -52,28 +52,6 @@ class StringTest(
self.checkraises(TypeError, string_tests.BadSeq1(), 'join', ' ')
self.checkequal('a b c', string_tests.BadSeq2(), 'join', ' ')
- def test_bug1001011(self):
- # Make sure join returns a NEW object for single item sequences
- # involving a subclass
- # Make sure that it is of the appropriate type
- # Check the optimisation still occurs for standard objects
- class str_subclass(str): pass
- s1 = str_subclass('abcd')
- s2 = ''.join([s1])
- self.failIf(s1 is s2)
- self.assertEqual(type(s2), type(''))
- s3 = 'abcd'
- s4 = ''.join([s3])
- self.failUnless(s3 is s4)
- if test_support.have_unicode:
- class unicode_subclass(unicode): pass
- u1 = unicode_subclass(u'abcd')
- u2 = ''.join([u1])
- self.failIf(u1 is u2)
- self.assertEqual(type(u2), type(u''))
- u3 = u'abcd'
- u4 = ''.join([u3])
- self.failUnless(u3 is u4)
class ModuleTest(unittest.TestCase):