def test_watch(self): clnk_module = core.extend_load("corr.main.coreLink") elnk_module = core.extend_load("corr.main.execLink") api_module = core.extend_load("corr.main.api") tag = None align_resp = coreLink.align(api="corr.main.api", elnk="corr.main.coreLink") assert align_resp == True reg_resp = coreLink.register(name="execution", api="corr.main.api", elnk="corr.main.coreLink") assert reg_resp != None tag_resp = coreLink.tag(name="execution", api="corr.main.api", elnk="corr.main.coreLink") assert tag_resp != None tag = tag_resp[0] # check what is the latest record now corr_path = imp.find_module("corr")[1] task_cmd = [] task_cmd.append("python") task_cmd.append("{0}/data/execution.py".format(corr_path)) task_cmd.append(tag) process = subprocess.Popen(task_cmd) tsk = CoRRTask( name="execution", tag=tag, clnk_module=clnk_module, api_module=api_module, elnk_module=elnk_module, timeout=60, ) records = tsk.run() assert len(records) > 0
def test_watch_unwatch(self): reg_resp = coreLink.register(name='execution', api='corr.main.api', elnk='corr.main.coreLink') assert reg_resp != None tag_resp = coreLink.tag(name='execution', api='corr.main.api', elnk='corr.main.coreLink') assert tag_resp != None self.tag = tag_resp[0] corr_path = imp.find_module('corr')[1] task_cmd = [] task_cmd.append('python') task_cmd.append('{0}/data/execution.py'.format(corr_path)) task_cmd.append(self.tag) watch_resp = coreLink.watch(name='execution', tag=self.tag, api='corr.main.api', elnk='corr.main.coreLink', ctsk='corr.main.corrTask') # print watch_resp[1] assert watch_resp[0] == True unwatch_resp = coreLink.unwatch(name='execution', tag=self.tag, api='corr.main.api', elnk='corr.main.coreLink', ctsk='corr.main.corrTask') # print unwatch_resp[1] assert unwatch_resp[0] == True
def test_register(self): reg_resp = coreLink.register(name='execution', api='corr.main.api', elnk='corr.main.coreLink') print reg_resp assert reg_resp != None