def run(self, data, name=None): result = KeywordResult(kwname=self._get_name(data), type=data.FOR_LOOP_TYPE, lineno=data.lineno, source=data.source) with StatusReporter(self._context, result): self._validate(data) self._run(data)
def run(self, kw, context): result = KeywordResult(kwname=self.name, libname=self.libname, args=kw.args, assign=kw.assign, type=kw.type) with StatusReporter(context, result): raise self.error
def run(self, data, name=None): result = KeywordResult(kwname=self._get_name(data), type=data.FOR_LOOP_TYPE, lineno=data.lineno, source=data.source) with StatusReporter(self._context, result): if data.error: raise DataError(data.error) self._run(data)
def _get_result(self, kw, assignment): handler = self._handler return KeywordResult(kwname=self.name, libname=handler.libname, doc=handler.shortdoc, args=kw.args, assign=tuple(assignment), tags=handler.tags, type=kw.type)
def run(self, kw, context, run=True): result = KeywordResult(kwname=self.name, libname=self.libname, args=kw.args, assign=tuple(VariableAssignment(kw.assign)), type=kw.type) with StatusReporter(kw, result, context, run): if run: raise self.error
def _run_one_round(self, data, values): variables = self._map_variables_and_values(data.variables, values) for name, value in variables: self._context.variables[name] = value name = ', '.join(format_assign_message(n, v) for n, v in variables) result = KeywordResult(kwname=name, type=data.FOR_ITEM_TYPE) runner = StepRunner(self._context, self._templated) with StatusReporter(self._context, result): runner.run_steps(data.keywords)
def run(self, kw, context): result = KeywordResult(kwname=self.name, libname=self.libname, args=kw.args, assign=kw.assign, type=kw.type) with StatusReporter(context, result): context.fail(self.error) raise ExecutionFailed(self.error, syntax=True)
def _run_one_round(self, data, values): name = ', '.join(format_assign_message(var, item) for var, item in zip(data.variables, values)) result = KeywordResult(kwname=name, type=data.FOR_ITEM_TYPE) for var, value in zip(data.variables, values): self._context.variables[var] = value runner = StepRunner(self._context, self._templated) with StatusReporter(self._context, result): runner.run_steps(data.keywords)
def run(self, kw, context, run=True): result = KeywordResult(kwname=self.name, libname=self.libname, args=kw.args, assign=kw.assign, type=kw.type, lineno=kw.lineno, source=kw.source) with StatusReporter(context, result, run): if run: raise self.error
def _get_result(self, kw, assignment, variables): handler = self._handler doc = variables.replace_string(handler.doc, ignore_errors=True) doc, tags = split_tags_from_doc(doc) tags = variables.replace_list(handler.tags, ignore_errors=True) + tags return KeywordResult(kwname=self.name, libname=handler.libname, doc=getshortdoc(doc), args=kw.args, assign=tuple(assignment), tags=tags, type=kw.type)
def _run_if_branch(self, data, branch_run=False, recursive_dry_run=False): result = KeywordResult(kwname=data.condition, type=data.type, lineno=data.lineno, source=data.source) with StatusReporter(self._context, result) as reporter: if data.error: raise DataError(data.error) if self._should_run_branch(data.condition, branch_run, recursive_dry_run): runner = StepRunner(self._context, self._templated) runner.run_steps(data.keywords) return True reporter.mark_as_not_run() return branch_run
def _branch_to_be_executed(self, data, first, datacondition, body, condition_matched_already): data_type = self._get_type(data, first, datacondition) condition_result = data_type == data.ELSE_TYPE unresolved_condition = '' if not condition_result: unresolved_condition = datacondition[0] if not condition_matched_already and not self._context.dry_run: condition_result = self._resolve_condition( unresolved_condition) branch_to_execute = self._is_branch_to_execute( condition_matched_already, condition_result, body) result = KeywordResult(kwname=self._get_name(unresolved_condition), type=data_type, lineno=data.lineno, source=data.source) return branch_to_execute, result
def _create_result_object(self, data, first, datacondition): data_type = self._get_type(data, first, datacondition) unresolved_condition = self._get_unresolved_condition(data, data_type, datacondition) return KeywordResult(kwname=self._get_name(unresolved_condition), type=data_type, lineno=data.lineno, source=data.source)
def run(self, data): result = KeywordResult(kwname='', type=data.PARALLEL_TYPE) runner = StepRunner(self._context, self._templated) with StatusReporter(self._context, result): runner.run_steps_parallel(data.keywords)