bimtester: geometric step translation improvement

This commit is contained in:
Bernd Hahnebach
2021-01-08 08:40:48 +01:00
parent 8eab1ec4a5
commit 2e85a80fc8
3 changed files with 25 additions and 7 deletions
@@ -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
)
@@ -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
)
@@ -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: