mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
bimtester: steps, improve ifcdata schema test
This commit is contained in:
@@ -2,7 +2,7 @@ import gettext # noqa
|
||||
from behave import given
|
||||
from behave import step
|
||||
|
||||
from ifcdata_methods import assert_schema
|
||||
import ifcdata_methods as idm
|
||||
from utils import IfcFile
|
||||
from utils import switch_locale
|
||||
|
||||
@@ -47,7 +47,7 @@ def step_impl(context):
|
||||
@step("IFC data must use the {schema} schema")
|
||||
def step_impl(context, schema):
|
||||
switch_locale(context.localedir, the_lang)
|
||||
assert_schema(context, schema)
|
||||
idm.has_ifcdata_specific_schema(context, schema)
|
||||
|
||||
|
||||
@step('The IFC file "{file}" is exempt from being provided')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from behave import step
|
||||
|
||||
from ifcdata_methods import assert_schema
|
||||
import ifcdata_methods as idm
|
||||
from utils import switch_locale
|
||||
|
||||
|
||||
@@ -10,4 +10,4 @@ the_lang = "de"
|
||||
@step("Die IFC Daten müssen das {schema} Schema benutzen")
|
||||
def step_impl(context, schema):
|
||||
switch_locale(context.localedir, the_lang)
|
||||
assert_schema(context, schema)
|
||||
idm.has_ifcdata_specific_schema(context, schema)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from behave import step
|
||||
|
||||
from ifcdata_methods import assert_schema
|
||||
import ifcdata_methods as idm
|
||||
from utils import switch_locale
|
||||
|
||||
|
||||
@@ -10,4 +10,4 @@ the_lang = "fr"
|
||||
@step("Les données IFC doivent utiliser le schéma {schema}")
|
||||
def step_impl(context, schema):
|
||||
switch_locale(context.localedir, the_lang)
|
||||
assert_schema(context, schema)
|
||||
idm.has_ifcdata_specific_schema(context, schema)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from utils import IfcFile
|
||||
|
||||
|
||||
def assert_schema(context, target_schema):
|
||||
def has_ifcdata_specific_schema(context, target_schema):
|
||||
real_schema = IfcFile.get().schema
|
||||
assert real_schema == target_schema, (
|
||||
_("We expected a schema of {} but instead got {}")
|
||||
|
||||
Reference in New Issue
Block a user