test_str.py revision 21d3a32b99c5763444c34c189ef653ac9745f3c4
10fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwaldimport unittest
20fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwaldfrom test import test_support, string_tests
30fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
40fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
50fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwaldclass StrTest(
60fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    string_tests.CommonTest,
70fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    string_tests.MixinStrUnicodeUserStringTest,
80fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    string_tests.MixinStrUserStringTest
90fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    ):
100fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
110fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    type2test = str
120fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
130fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    # We don't need to propagate to str
140fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    def fixtype(self, obj):
150fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald        return obj
160fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
1743440a621e022fbeaff24f84dcf4d5458601fedcWalter Dörwald    def test_formatting(self):
1843440a621e022fbeaff24f84dcf4d5458601fedcWalter Dörwald        string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
1943440a621e022fbeaff24f84dcf4d5458601fedcWalter Dörwald        self.assertRaises(OverflowError, '%c'.__mod__, 0x1234)
2043440a621e022fbeaff24f84dcf4d5458601fedcWalter Dörwald
210fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwalddef test_main():
2221d3a32b99c5763444c34c189ef653ac9745f3c4Walter Dörwald    test_support.run_unittest(StrTest)
230fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald
240fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwaldif __name__ == "__main__":
250fd583ce4d1500938c96c12c698a535ad0938470Walter Dörwald    test_main()
26