'Set up test method.'

def setUp(self):

    super(ApiRegressionTest, self).setUp()
    if (not self.__class__.api_method):
        raise ValueError(('%s.api_method    has    to    be    set.' % self.__class__.__name__))
    if (not self.__class__.handler):
        raise ValueError(('%s.handler    has    to    be    set.' % self.__class__.__name__))
    self.checks = []
    p = psutil.Process(os.getpid())
    self.syscalls_stubber = utils.MultiStubber((socket, 'gethostname', (lambda : 'test.host')), (os, 'getpid', (lambda : 42)), (psutil, 'Process', (lambda _=None: p)))
    self.syscalls_stubber.Start()
    self.token.username = 'api_test_user'
    webauth.WEBAUTH_MANAGER.SetUserName(self.token.username)
    api_auth_manager.APIACLInit.InitApiAuthManager()
