Walter Dörwald | 0fd583c | 2003-02-21 12:53:50 +0000 | [diff] [blame] | 1 | import unittest |
| 2 | from test import test_support, string_tests |
| 3 | |
| 4 | |
| 5 | class StrTest( |
| 6 | string_tests.CommonTest, |
| 7 | string_tests.MixinStrUnicodeUserStringTest, |
| 8 | string_tests.MixinStrUserStringTest |
| 9 | ): |
| 10 | |
| 11 | type2test = str |
| 12 | |
| 13 | # We don't need to propagate to str |
| 14 | def fixtype(self, obj): |
| 15 | return obj |
| 16 | |
Walter Dörwald | 43440a6 | 2003-03-31 18:07:50 +0000 | [diff] [blame] | 17 | def test_formatting(self): |
| 18 | string_tests.MixinStrUnicodeUserStringTest.test_formatting(self) |
| 19 | self.assertRaises(OverflowError, '%c'.__mod__, 0x1234) |
| 20 | |
Walter Dörwald | 0fd583c | 2003-02-21 12:53:50 +0000 | [diff] [blame] | 21 | def test_main(): |
| 22 | suite = unittest.TestSuite() |
| 23 | suite.addTest(unittest.makeSuite(StrTest)) |
| 24 | test_support.run_suite(suite) |
| 25 | |
| 26 | if __name__ == "__main__": |
| 27 | test_main() |