From 4fa652d8a0eed391e88e62c1fb226a41546fcda1 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 1 Nov 2017 16:54:48 +0800 Subject: [PATCH] add bind_extracted_variables: extracted value do not need to evaluate --- ate/context.py | 10 ++++++++++ ate/runner.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ate/context.py b/ate/context.py index 36b6a64c..cda6c5a3 100644 --- a/ate/context.py +++ b/ate/context.py @@ -119,6 +119,16 @@ class Context(object): self.testcase_variables_mapping[variable_name] = variable_evale_value self.testcase_parser.update_binded_variables(self.testcase_variables_mapping) + def bind_extracted_variables(self, variables): + """ bind extracted variables to testset context + @param (OrderDict) variables + extracted value do not need to evaluate. + """ + for variable_name, value in variables.items(): + self.testset_shared_variables_mapping[variable_name] = value + self.testcase_variables_mapping[variable_name] = value + self.testcase_parser.update_binded_variables(self.testcase_variables_mapping) + def __update_context_functions_config(self, level, config_mapping): """ @param level: testset or testcase diff --git a/ate/runner.py b/ate/runner.py index b04ce320..7c80de96 100644 --- a/ate/runner.py +++ b/ate/runner.py @@ -126,7 +126,7 @@ class Runner(object): resp_obj = response.ResponseObject(resp) extracted_variables_mapping = resp_obj.extract_response(extractors) - self.context.bind_variables(extracted_variables_mapping, level="testset") + self.context.bind_extracted_variables(extracted_variables_mapping) try: resp_obj.validate(validators, self.context.get_testcase_variables_mapping())