def METHOD_NAME(self, mocked_init):
    executable_tasks_count = 0
    raptor_tasks_count     = 0
    advanced_tasks         = []
    def advance_side_effect(*args, **kwargs):
        nonlocal executable_tasks_count
        nonlocal raptor_tasks_count
        state = kwargs.get('state')
        if state == rps.AGENT_STAGING_INPUT_PENDING:
            executable_tasks_count += len(args[0])
        elif state == rps.AGENT_SCHEDULING:
            raptor_tasks_count += len(args[0])
        else:
            return
        advanced_tasks.extend(args[0])
    raptor_master = Master(cfg=None)
    raptor_master._uid          = 'master.0000'
    raptor_master._cfg          = {}
    raptor_master._info         = mock.Mock()
    raptor_master._task_service = mock.Mock()
    raptor_master._req_put      = mock.Mock()
    raptor_master._log          = mock.Mock()
    raptor_master._session      = self._session
    raptor_master._psbox        = '/tmp/pilot.0000'
    raptor_master._ssbox        = '/tmp'
    raptor_master._rsbox        = '/tmp'
    raptor_master._pid          = 'pilot.0000'
    raptor_master.publish       = mock.Mock()
    raptor_master.advance       = mock.Mock(side_effect=advance_side_effect)
    # 1 executable task and 2 raptor tasks
    tasks = [
        {
            'uid'        : 'task.0000',
            'description': {'uid'       : 'task.0000',
                            'ranks'     : 1,
                            'mode'      : rp.TASK_EXECUTABLE,
                            'executable': '/bin/date',
                            'sandbox'   : '/tmp'}
        },
        {
            'uid'        : 'task.0001',
            'description': {'uid'       : 'task.0001',
                            'ranks'     : 1,
                            'mode'      : rp.TASK_FUNCTION,
                            'function'  : 'test',
                            'sandbox'   : ''}
        },
        {
            'uid'        : 'task.0002',
            'description': {'uid'       : 'task.0002',
                            'ranks'     : 1,
                            'mode'      : rp.TASK_FUNCTION,
                            'function'  : 'test',
                            'sandbox'   : 'task_in_psbox'}
        }
    ]
    raptor_master.submit_tasks(tasks)
    self.assertEqual(executable_tasks_count, 1)
    self.assertEqual(raptor_tasks_count,     2)
    for task in advanced_tasks:
        td = task['description']
        if td['sandbox']:
            if td['sandbox'].startswith('/'):
                self.assertEqual(task['task_sandbox_path'], td['sandbox'])
            else:
                self.assertTrue(task['task_sandbox_path'].
                                startswith(raptor_master._psbox))
                self.assertTrue(task['task_sandbox_path'].
                                endswith(td['sandbox'] + '/'))
        else:
            self.assertTrue(task['task_sandbox_path'].
                            startswith(raptor_master._psbox))
            self.assertTrue(task['task_sandbox_path'].
                            endswith(td['uid'] + '/'))