From 2acf0020663a3b9b80708372afbc5a680afda29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= Date: Fri, 26 May 2023 13:58:49 +0200 Subject: [PATCH] Reduce amount of parameters --- tests/test_components.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_components.py b/tests/test_components.py index d89042185c08..7146ebb1c941 100644 --- a/tests/test_components.py +++ b/tests/test_components.py @@ -178,9 +178,10 @@ def test_benchmark_rules(components, source_dir): return result -def test_rule( - rule, rule_to_components, package_to_component, - template_to_component, rule_to_groups, group_to_components): +def test_rule(rule, mappings): + ( + rule_to_components, package_to_component, template_to_component, + rule_to_groups, group_to_components) = mappings result = True rule_components = [c.name for c in rule_to_components[rule.id_]] rule_groups = rule_to_groups[rule.id_] @@ -207,10 +208,11 @@ def test_resolved_rules(components, build_dir, product): groups_dir = os.path.join(product_dir, "groups") rule_to_groups = get_rule_to_groups(groups_dir) rules_dir = os.path.join(product_dir, "rules") + mappings = ( + rule_to_components, package_to_component, template_to_component, + rule_to_groups, group_to_components) for rule in iterate_over_resolved_rules(rules_dir): - if not test_rule( - rule, rule_to_components, package_to_component, - template_to_component, rule_to_groups, group_to_components): + if not test_rule(rule, mappings): result = False return result