I need to call the class methods based on the command line argument
params = sys.argv[1].split('.')
print params
['Abc', 'test']
suite.addTest(params[0](params[1]))
Traceback (most recent call last):
File "policy.py", line 407, in <module>
suite.addTest(params[0](params[1]))
TypeError: 'str' object is not callable
Is their any way to call a class method.
Abcclass defined?TestClass = globals()[params[0]]and thengetattr(TestClass, params[1]).