aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_str.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-15 21:10:24 +0000
committerGuido van Rossum <guido@python.org>2007-05-15 21:10:24 +0000
commitea0ebd807507e94d06ed2ff046f5bb6693400ecd (patch)
tree34b6795135912426d2b962e1af161a8c579923da /Lib/test/test_str.py
parent2be161dcfa531b0e2f3f9887e198be59f477854e (diff)
downloadcpython-ea0ebd807507e94d06ed2ff046f5bb6693400ecd.tar.gz
cpython-ea0ebd807507e94d06ed2ff046f5bb6693400ecd.zip
Make test_str.py pass.
Diffstat (limited to 'Lib/test/test_str.py')
-rw-r--r--Lib/test/test_str.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
index 2936dcaa5ef..be26b242f64 100644
--- a/Lib/test/test_str.py
+++ b/Lib/test/test_str.py
@@ -29,9 +29,6 @@ class StrTest(
def test_conversion(self):
# Make sure __str__() behaves properly
- class Foo0:
- def __unicode__(self):
- return "foo"
class Foo1:
def __str__(self):
@@ -45,15 +42,15 @@ class StrTest(
def __str__(self):
return "foo"
- class Foo4(str):
+ class Foo4(str8):
def __str__(self):
return "foo"
class Foo5(str):
- def __str__(self):
+ def __unicode__(self):
return "foo"
- class Foo6(str):
+ class Foo6(str8):
def __str__(self):
return "foos"
@@ -72,22 +69,23 @@ class StrTest(
def __str__(self):
return self
- class Foo9(str):
+ class Foo9(str8):
def __str__(self):
return "string"
def __unicode__(self):
return "not unicode"
- self.assert_(str(Foo0()).startswith("<")) # this is different from __unicode__
self.assertEqual(str(Foo1()), "foo")
self.assertEqual(str(Foo2()), "foo")
self.assertEqual(str(Foo3()), "foo")
self.assertEqual(str(Foo4("bar")), "foo")
self.assertEqual(str(Foo5("bar")), "foo")
- self.assertEqual(str(Foo6("bar")), "foos")
- self.assertEqual(str(Foo7("bar")), "foos")
+ self.assertEqual(str8(Foo6("bar")), "foos")
+ self.assertEqual(str(Foo6("bar")), "foou")
+ self.assertEqual(str8(Foo7("bar")), "foos")
+ self.assertEqual(str(Foo7("bar")), "foou")
self.assertEqual(str(Foo8("foo")), "foofoo")
- self.assertEqual(str(Foo9("foo")), "string")
+ self.assertEqual(str8(Foo9("foo")), "string")
self.assertEqual(str(Foo9("foo")), "not unicode")
def test_main():