3 from test_support
import verbose
5 # UserString is a wrapper around the native builtin string type.
6 # UserString instances should behave similar to builtin string objects.
7 # The test cases were in part derived from 'test_string.py'.
8 from UserString
import UserString
10 if __name__
== "__main__":
15 def test(methodname
, input, *args
):
17 tested_methods
[methodname
] = 1
19 print '%s.%s(%s) ' % (input, methodname
, args
),
21 objects
= [input, u
, UserString(u
)]
26 f
= getattr(object, methodname
)
27 res
[i
] = apply(f
, args
)
33 print `
input`
, f
, `res
[0]`
, "<>", `res
[1]`
40 print `
input`
, f
, `res
[1]`
, "<>", `res
[2]`
45 string_tests
.run_method_tests(test
)