Back to index

python3.2  3.2.2
Public Member Functions
test.string_tests.MixinStrUnicodeTest Class Reference
Inheritance diagram for test.string_tests.MixinStrUnicodeTest:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def test_bug1001011

Detailed Description

Definition at line 1244 of file string_tests.py.


Member Function Documentation

Definition at line 1247 of file string_tests.py.

01247 
01248     def test_bug1001011(self):
01249         # Make sure join returns a NEW object for single item sequences
01250         # involving a subclass.
01251         # Make sure that it is of the appropriate type.
01252         # Check the optimisation still occurs for standard objects.
01253         t = self.type2test
01254         class subclass(t):
01255             pass
01256         s1 = subclass("abcd")
01257         s2 = t().join([s1])
01258         self.assertIsNot(s1, s2)
01259         self.assertIs(type(s2), t)
01260 
01261         s1 = t("abcd")
01262         s2 = t().join([s1])
01263         self.assertIs(s1, s2)
01264 
01265         # Should also test mixed-type join.
01266         if t is str:
01267             s1 = subclass("abcd")
01268             s2 = "".join([s1])
01269             self.assertIsNot(s1, s2)
01270             self.assertIs(type(s2), t)
01271 
01272             s1 = t("abcd")
01273             s2 = "".join([s1])
01274             self.assertIs(s1, s2)

Here is the call graph for this function:


The documentation for this class was generated from the following file: