Put the docstring inside the method.
def name(self, name):
'''
This function parses a name according to following rules -
>>> name('Kshitiz Sharma')
<BLANKLINE>
'''
pass
Also to run the test on a method correctly you'll need to actually instantiate the class to have access to the method during the test itself:
>>> t = Test(); t.name('Kshitiz Sharma')
<BLANKLINE>