1 from test_support
import verbose
, TestSkipped
5 # XXX: kludge... short circuit if strings don't have methods
11 def test(name
, input, output
, *args
):
13 print 'string.%s%s =? %s... ' % (name
, (input,) + args
, output
),
15 # Prefer string methods over string module functions
17 f
= getattr(input, name
)
18 value
= apply(f
, args
)
19 except AttributeError:
20 f
= getattr(string
, name
)
21 value
= apply(f
, (input,) + args
)
27 print f
, `
input`
, `output`
, `value`
32 string_tests
.run_module_tests(test
)
33 string_tests
.run_method_tests(test
)