예제 #1
0
 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)
예제 #2
0
 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
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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
예제 #6
0
 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)
예제 #7
0
 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)
예제 #8
0
 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)
예제 #9
0
 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)
예제 #11
0
 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
예제 #12
0
 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
예제 #13
0
 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)
예제 #14
0
 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)