From 1f6787692898238b5e1a8508c28da81476e9e5d0 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 15 Nov 2019 17:25:11 -0300 Subject: [PATCH] validate:launcher: Use python dict for pipeline description --- validate/launcher/apps/gstvalidate.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/validate/launcher/apps/gstvalidate.py b/validate/launcher/apps/gstvalidate.py index 9854dfbaca..9742a6829c 100644 --- a/validate/launcher/apps/gstvalidate.py +++ b/validate/launcher/apps/gstvalidate.py @@ -212,7 +212,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator): self._valid_scenarios = valid_scenarios @classmethod - def from_json(cls, test_manager, json_file, extra_data=None): + def from_dict(cls, test_manager, name, descriptions, extra_data=None): """ :param json_file: Path to a JSON file containing pipeline tests. :param extra_data: Variables available for interpolation in validate @@ -220,10 +220,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator): """ if extra_data is None: extra_data = {} - with open(json_file, 'r') as f: - descriptions = json.load(f) - name = os.path.basename(json_file).replace('.json', '') pipelines_descriptions = [] for test_name, defs in descriptions.items(): tests_definition = {'name': test_name, 'pipeline': defs.pop('pipeline')} @@ -268,7 +265,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator): expand_vars_in_dict_recurse(local_extra_data, extra_data) tests_definition['extra_data'] = local_extra_data - tests_definition['pipeline_data'] = {"config_path": os.path.dirname(json_file)} + tests_definition['pipeline_data'] = {} tests_definition['pipeline_data'].update(local_extra_data) pipelines_descriptions.append(tests_definition)