def check_current_test(self, data): user_result = data['result'] self.referee_data = self.process_referee(self.referee_data, user_result) referee_result = self.referee_data.get("result", False) is_win_result = False if referee_result: is_win_result = self.is_win_referee(self.referee_data) self.referee_data.update({"is_win": is_win_result}) api.request_write_ext(self.referee_data) if not referee_result: return api.fail(self.current_step, self.get_current_test_fullname()) if not is_win_result: self.next_step = True api.kill_runner('req') else: if self.next_env(): self.restart_env() else: api.success()
def process_req_ended(self, data): self.run_count += 1 if self.run_count < self.quantity: api.kill_runner(REQ + str(self.run_count)) else: self.run_count = 0 if self.restarting_env: self.restarting_env = False self.start_env() else: api.fail(self.current_step, self.get_current_test_fullname())
def restart_env(self): self.restarting_env = True api.kill_runner('req')
def restart_env(self): self.restarting_env = True api.kill_runner("req")
def restart_env(self): self.restarting_env = True api.kill_runner(REQ + str(self.run_count))