From a04ce8a24d7a40737d142f90afc2116c3fe20dee Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 15 Jan 2021 20:35:12 +0100 Subject: [PATCH] bimtester: steps, translate some project attribute tests --- .../features/steps/project_setup_de.py | 20 ++++++++++++++++ .../features/steps/project_setup_fr.py | 23 +++++++++++++++++++ .../features/grundlagen.feature | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/ifcbimtester/bimtester/features/steps/project_setup_de.py create mode 100644 src/ifcbimtester/bimtester/features/steps/project_setup_fr.py diff --git a/src/ifcbimtester/bimtester/features/steps/project_setup_de.py b/src/ifcbimtester/bimtester/features/steps/project_setup_de.py new file mode 100644 index 0000000000..56ff7d3359 --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/project_setup_de.py @@ -0,0 +1,20 @@ +from behave import step + +from utils import assert_attribute +from utils import IfcFile +from utils import switch_locale + + +the_lang = "de" + + +@step("Die Globale Identifikationskennung (Globally Unique Identifier = GUID) des Projektes ist {guid}") +def step_impl(context, guid): + switch_locale(context.localedir, the_lang) + assert_attribute(IfcFile.get().by_type("IfcProject")[0], "GlobalId", guid) + + +@step('Der Name, die Abkürzung oder die Kurzkennung des Projektes ist "{value}"') +def step_impl(context, value): + switch_locale(context.localedir, the_lang) + assert_attribute(IfcFile.get().by_type("IfcProject")[0], "Name", value) diff --git a/src/ifcbimtester/bimtester/features/steps/project_setup_fr.py b/src/ifcbimtester/bimtester/features/steps/project_setup_fr.py new file mode 100644 index 0000000000..c8f6621e6f --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/project_setup_fr.py @@ -0,0 +1,23 @@ +from behave import step + +from utils import assert_attribute +from utils import IfcFile +from utils import switch_locale + + +the_lang = "fr" + + +""" +# TODO the next line needs translation +@step("The project must have an identifier of {guid}") +def step_impl(context, guid): + switch_locale(context.localedir, the_lang) + assert_attribute(IfcFile.get().by_type("IfcProject")[0], "GlobalId", guid) + + +@step('The project name, code, or short identifier must be "{value}"') +def step_impl(context, value): + switch_locale(context.localedir, the_lang) + assert_attribute(IfcFile.get().by_type("IfcProject")[0], "Name", value) +""" diff --git a/src/ifcbimtester/examples/01_ifcschema_translated/features/grundlagen.feature b/src/ifcbimtester/examples/01_ifcschema_translated/features/grundlagen.feature index b46dcf82c7..a6b5ad044b 100644 --- a/src/ifcbimtester/examples/01_ifcschema_translated/features/grundlagen.feature +++ b/src/ifcbimtester/examples/01_ifcschema_translated/features/grundlagen.feature @@ -14,4 +14,4 @@ Szenario: Bereitstellen von IFC-Daten Szenario: Projektinformationen - * The project name, code, or short identifier must be "BIMTester Example 1" + * Der Name, die Abkürzung oder die Kurzkennung des Projektes ist "BIMTester Example 1"