'Return a sorted sequence of method names found within testCaseClass'

def getTestCaseNames(self, testCaseClass):

    def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix):
        return (attrname.startswith(prefix) and hasattr(getattr(testCaseClass, attrname), '__call__'))
    testFnNames = filter(isTestMethod, dir(testCaseClass))
    if self.sortTestMethodsUsing:
        testFnNames.sort(key=_CmpToKey(self.sortTestMethodsUsing))
    return testFnNames
