summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-10-26 18:43:10 (GMT)
committerGuido van Rossum <guido@python.org>2007-10-26 18:43:10 (GMT)
commit35d02c1649e577a142e769159b2da9f395e30c29 (patch)
tree3d45f22182f25bd3964be53bff9088386e6f2aa6 /Lib
parenta5d2d5573a6dc24f6b0de8dd089290216bd96249 (diff)
downloadcpython-35d02c1649e577a142e769159b2da9f395e30c29.zip
cpython-35d02c1649e577a142e769159b2da9f395e30c29.tar.gz
cpython-35d02c1649e577a142e769159b2da9f395e30c29.tar.bz2
Delete test_str.py. There's not much there I care about, and it is confused
about whether it's testing str8 or str... The stuff that matters is already tested in test_unicode.py anyway.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_str.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
deleted file mode 100644
index 1d02467..0000000
--- a/Lib/test/test_str.py
+++ /dev/null
@@ -1,66 +0,0 @@
-
-import unittest
-import struct
-import sys
-from test import test_support, string_tests
-
-
-class StrTest(
- string_tests.CommonTest,
- string_tests.MixinStrUnicodeUserStringTest,
- string_tests.MixinStrUnicodeTest,
- ):
-
- type2test = str8
-
- # We don't need to propagate to str
- def fixtype(self, obj):
- return obj
-
- def test_formatting(self):
- string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
- self.assertRaises(OverflowError, '%c'.__mod__, 0x12341234)
-
- def test_iterators(self):
- # Make sure str objects have an __iter__ method
- it = "abc".__iter__()
- self.assertEqual(next(it), "a")
- self.assertEqual(next(it), "b")
- self.assertEqual(next(it), "c")
- self.assertRaises(StopIteration, next, it)
-
- def test_conversion(self):
- # Make sure __str__() behaves properly
-
- class Foo1:
- def __str__(self):
- return "foo"
-
- class Foo7(str):
- def __str__(self):
- return "foos"
-
- class Foo8(str):
- def __new__(cls, content=""):
- return str.__new__(cls, 2*content)
- def __str__(self):
- return self
-
- self.assertEqual(str(Foo1()), "foo")
- self.assertEqual(str(Foo7("bar")), "foos")
- self.assertEqual(str(Foo8("foo")), "foofoo")
-
- def test_expandtabs_overflows_gracefully(self):
- # This test only affects 32-bit platforms because expandtabs can only take
- # an int as the max value, not a 64-bit C long. If expandtabs is changed
- # 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, 't\tt\t'.expandtabs, sys.maxint)
-
-
-def test_main():
- test_support.run_unittest(StrTest)
-
-if __name__ == "__main__":
- test_main()