From 2e85a80fc89efb65dc10086d2c9cccdf36ea771c Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 8 Jan 2021 08:40:48 +0100 Subject: [PATCH] bimtester: geometric step translation improvement --- .../bimtester/features/steps/geometric_detail.py | 13 ++++++++++--- .../bimtester/features/steps/geometric_detail_de.py | 13 ++++++++++--- .../features/steps/geometric_detail_methods.py | 6 +++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/ifcbimtester/bimtester/features/steps/geometric_detail.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail.py index 594b42b4e6..8b23c996eb 100644 --- a/src/ifcbimtester/bimtester/features/steps/geometric_detail.py +++ b/src/ifcbimtester/bimtester/features/steps/geometric_detail.py @@ -1,11 +1,14 @@ from behave import step -from geometric_detail_methods import class_geometric_representation +import geometric_detail_methods as gdm from utils import assert_elements from utils import IfcFile from utils import switch_locale +the_lang = "en" + + @step("All elements must be under {number} polygons") def step_impl(context, number): number = int(number) @@ -36,5 +39,9 @@ def step_impl(context, number): @step("all {ifc_class} elements have an {representation_class} representation") def step_impl(context, ifc_class, representation_class): - switch_locale(context.localedir, "en") - class_geometric_representation(context, ifc_class, representation_class) + switch_locale(context.localedir, the_lang) + gdm.eleclass_has_geometric_representation_of_specific_class( + context, + ifc_class, + representation_class + ) diff --git a/src/ifcbimtester/bimtester/features/steps/geometric_detail_de.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail_de.py index 8b1977b42e..92c2f9a94c 100644 --- a/src/ifcbimtester/bimtester/features/steps/geometric_detail_de.py +++ b/src/ifcbimtester/bimtester/features/steps/geometric_detail_de.py @@ -1,10 +1,17 @@ from behave import step -from geometric_detail_methods import class_geometric_representation +import geometric_detail_methods as gdm from utils import switch_locale +the_lang = "de" + + @step("Alle {ifc_class} Bauteile müssen eine geometrische Repräsentation der Klasse {representation_class} verwenden") def step_impl(context, ifc_class, representation_class): - switch_locale(context.localedir, "de") - class_geometric_representation(context, ifc_class, representation_class) + switch_locale(context.localedir, the_lang) + gdm.eleclass_has_geometric_representation_of_specific_class( + context, + ifc_class, + representation_class + ) diff --git a/src/ifcbimtester/bimtester/features/steps/geometric_detail_methods.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail_methods.py index 5a321abc32..c66e179f05 100644 --- a/src/ifcbimtester/bimtester/features/steps/geometric_detail_methods.py +++ b/src/ifcbimtester/bimtester/features/steps/geometric_detail_methods.py @@ -3,7 +3,11 @@ from utils import assert_elements from utils import IfcFile -def class_geometric_representation(context, ifc_class, representation_class): +def eleclass_has_geometric_representation_of_specific_class( + context, + ifc_class, + representation_class +): def is_item_a_representation(item, representation): if "/" in representation: