From 1d0b13960f97c6557c6399d8d37b32f8b8f57729 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 15 Jan 2021 20:20:18 +0100 Subject: [PATCH] bimtester: steps, translate some attributes --- .../features/steps/attributes_eleclasses.py | 24 +++++--- .../steps/attributes_eleclasses_de.py | 52 ++++++++++++++++ .../steps/attributes_eleclasses_fr.py | 59 +++++++++++++++++++ .../steps/attributes_eleclasses_methods.py | 4 +- .../features/steps/attributes_psets_de.py | 18 ++++++ .../features/steps/attributes_psets_fr.py | 21 +++++++ .../features/steps/geometric_detail_fr.py | 20 +++++++ 7 files changed, 188 insertions(+), 10 deletions(-) create mode 100644 src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_de.py create mode 100644 src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_fr.py create mode 100644 src/ifcbimtester/bimtester/features/steps/attributes_psets_de.py create mode 100644 src/ifcbimtester/bimtester/features/steps/attributes_psets_fr.py create mode 100644 src/ifcbimtester/bimtester/features/steps/geometric_detail_fr.py diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses.py b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses.py index 32246796c4..3921418fc7 100644 --- a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses.py +++ b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses.py @@ -9,17 +9,25 @@ from utils import switch_locale the_lang = "en" -@step("there are no {ifc_class} elements because {reason}") -def step_impl(context, ifc_class, reason): +@step("There are no {ifc_class} elements") +def step_impl(context, ifc_class): switch_locale(context.localedir, the_lang) - aem.no_eleclass_because_reason( + aem.no_eleclass( context, - ifc_class, - reason + ifc_class ) -@step('all {ifc_class} elements class attributes have a value') +@step("There are no {ifc_class} elements because {reason}") +def step_impl(context, ifc_class, reason): + switch_locale(context.localedir, the_lang) + aem.no_eleclass( + context, + ifc_class + ) + + +@step("All {ifc_class} elements class attributes have a value") def step_impl(context, ifc_class): switch_locale(context.localedir, the_lang) aem.eleclass_have_class_attributes_with_a_value( @@ -28,7 +36,7 @@ def step_impl(context, ifc_class): ) -@step('all {ifc_class} elements have a name given') +@step("All {ifc_class} elements have a name given") def step_impl(context, ifc_class): switch_locale(context.localedir, the_lang) aem.eleclass_has_name_with_a_value( @@ -37,7 +45,7 @@ def step_impl(context, ifc_class): ) -@step('all {ifc_class} elements have a description given') +@step("All {ifc_class} elements have a description given") def step_impl(context, ifc_class): switch_locale(context.localedir, the_lang) aem.eleclass_has_description_with_a_value( diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_de.py b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_de.py new file mode 100644 index 0000000000..51517ab5b0 --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_de.py @@ -0,0 +1,52 @@ +from behave import step + +import attributes_eleclasses_methods as aem +from utils import switch_locale + + +the_lang = "de" + + +@step("Es sind keine {ifc_class} Bauteile vorhanden") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.no_eleclass( + context, + ifc_class + ) + + +@step("Aus folgendem Grund gibt es keine {ifc_class} Bauteile: {reason}") +def step_impl(context, ifc_class, reason): + switch_locale(context.localedir, the_lang) + aem.no_eleclass( + context, + ifc_class + ) + + +@step("Alle {ifc_class} Bauteilklassenattribute haben einen Wert") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_have_class_attributes_with_a_value( + context, + ifc_class + ) + + +@step("Bei allen {ifc_class} Bauteile ist der Name angegeben") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_has_name_with_a_value( + context, + ifc_class + ) + + +@step("Bei allen {ifc_class} Bauteile ist die Beschreibung angegeben") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_has_description_with_a_value( + context, + ifc_class + ) diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_fr.py b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_fr.py new file mode 100644 index 0000000000..adbf1d9796 --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_fr.py @@ -0,0 +1,59 @@ +from behave import step + +import attributes_eleclasses_methods as aem +from utils import switch_locale + + +the_lang = "fr" + + +""" +# TODO the next line needs translation +@step("There are no {ifc_class} elements") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.no_eleclass( + context, + ifc_class + ) + + +# TODO the next line needs translation +@step("There are no {ifc_class} elements because {reason}") +def step_impl(context, ifc_class, reason): + switch_locale(context.localedir, the_lang) + aem.no_eleclass( + context, + ifc_class + ) + + +# TODO the next line needs translation +@step("All {ifc_class} elements class attributes have a value") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_have_class_attributes_with_a_value( + context, + ifc_class + ) + + +# TODO the next line needs translation +@step("All {ifc_class} elements have a name given") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_has_name_with_a_value( + context, + ifc_class + ) + + +# TODO the next line needs translation +@step("All {ifc_class} elements have a description given") +def step_impl(context, ifc_class): + switch_locale(context.localedir, the_lang) + aem.eleclass_has_description_with_a_value( + context, + ifc_class + ) +""" diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_methods.py b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_methods.py index 77b69296c6..018d01f0a8 100644 --- a/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_methods.py +++ b/src/ifcbimtester/bimtester/features/steps/attributes_eleclasses_methods.py @@ -4,8 +4,8 @@ from utils import assert_elements from utils import IfcFile -def no_eleclass_because_reason( - context, ifc_class, reason +def no_eleclass( + context, ifc_class ): context.falseelems = [] diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_psets_de.py b/src/ifcbimtester/bimtester/features/steps/attributes_psets_de.py new file mode 100644 index 0000000000..941350becd --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/attributes_psets_de.py @@ -0,0 +1,18 @@ +from behave import step + +import attributes_psets_methods as apm +from utils import switch_locale + + +the_lang = "de" + + +@step("An alle {ifc_class} Bauteile ist im PSet {pset} das Attribut {aproperty} angehÃĪngt") +def step_impl(context, ifc_class, aproperty, pset): + switch_locale(context.localedir, the_lang) + apm.eleclass_has_property_in_pset( + context, + ifc_class, + aproperty, + pset + ) diff --git a/src/ifcbimtester/bimtester/features/steps/attributes_psets_fr.py b/src/ifcbimtester/bimtester/features/steps/attributes_psets_fr.py new file mode 100644 index 0000000000..29030d583e --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/attributes_psets_fr.py @@ -0,0 +1,21 @@ +from behave import step + +import attributes_psets_methods as apm +from utils import switch_locale + + +the_lang = "fr" + + +""" +# TODO the next line needs translation +@step("All {ifc_class} elements have an {aproperty} property in the {pset} pset") +def step_impl(context, ifc_class, aproperty, pset): + switch_locale(context.localedir, the_lang) + apm.eleclass_has_property_in_pset( + context, + ifc_class, + aproperty, + pset + ) +""" diff --git a/src/ifcbimtester/bimtester/features/steps/geometric_detail_fr.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail_fr.py new file mode 100644 index 0000000000..b1e285e1a8 --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/geometric_detail_fr.py @@ -0,0 +1,20 @@ +from behave import step + +import geometric_detail_methods as gdm +from utils import switch_locale + + +the_lang = "fr" + + +""" +# TODO the next line needs translation +@step("all {ifc_class} elements have an {representation_class} representation") +def step_impl(context, ifc_class, representation_class): + switch_locale(context.localedir, the_lang) + gdm.eleclass_has_geometric_representation_of_specific_class( + context, + ifc_class, + representation_class + ) +"""