bimtester: steps, translate ifcdata provide ifc file by argument

This commit is contained in:
Bernd Hahnebach
2021-01-15 20:06:11 +01:00
parent 2e07fd1cde
commit 418574fe40
5 changed files with 31 additions and 8 deletions
@@ -28,12 +28,10 @@ def step_impl(context, file):
assert False, f"The file {file} could not be loaded"
@given('The IFC file has been provided through an argument')
@given("The IFC file has been provided through an argument")
def step_impl(context):
try:
IfcFile.load(context.config.userdata.get("ifcfile"))
except:
assert False, f"The IFC {context.config.userdata.get('ifcfile')} file could not be loaded"
switch_locale(context.localedir, the_lang)
idm.provide_ifcfile_by_argument(context)
@given('A file path has been provided through an argument')
@@ -7,7 +7,13 @@ from utils import switch_locale
the_lang = "de"
@step("Die IFC Daten müssen das {schema} Schema benutzen")
@given("Die IFC-Datei wurde durch einen Startparameter zur Verfügung gestellt")
def step_impl(context):
switch_locale(context.localedir, the_lang)
idm.provide_ifcfile_by_argument(context)
@step("Die IFC-Daten müssen das {schema} Schema benutzen")
def step_impl(context, schema):
switch_locale(context.localedir, the_lang)
idm.has_ifcdata_specific_schema(context, schema)
@@ -7,6 +7,15 @@ from utils import switch_locale
the_lang = "fr"
"""
# TODO the next line needs translation
@given("The IFC file has been provided through an argument")
def step_impl(context):
switch_locale(context.localedir, the_lang)
idm.provide_ifcfile_by_argument(context)
"""
@step("Les données IFC doivent utiliser le schéma {schema}")
def step_impl(context, schema):
switch_locale(context.localedir, the_lang)
@@ -1,6 +1,16 @@
from utils import IfcFile
def provide_ifcfile_by_argument(context):
try:
IfcFile.load(context.config.userdata.get("ifcfile"))
except:
assert False, (
_("The IFC {} file could not be loaded")
.format(context.config.userdata.get('ifcfile'))
)
def has_ifcdata_specific_schema(context, target_schema):
real_schema = IfcFile.get().schema
assert real_schema == target_schema, (
@@ -9,8 +9,8 @@ Wir brauchen eine IFC-Datei
Szenario: Bereitstellen von IFC-Daten
* The IFC file has been provided through an argument
* Die IFC Daten müssen das IFC2X3 Schema benutzen
* Die IFC-Datei wurde durch einen Startparameter zur Verfügung gestellt
* Die IFC-Daten müssen das IFC2X3 Schema benutzen
Szenario: Projektinformationen