diff --git a/src/ifcbimtester/bimtester/features/steps/all.py b/src/ifcbimtester/bimtester/features/steps/all.py index 3b66c348f5..9ace4b10f1 100644 --- a/src/ifcbimtester/bimtester/features/steps/all.py +++ b/src/ifcbimtester/bimtester/features/steps/all.py @@ -1,6 +1,9 @@ use_step_matcher("parse") from bimtester.features.steps.aggregation import en +use_step_matcher("parse") +from bimtester.features.steps.application import en + use_step_matcher("parse") from bimtester.features.steps.attributes_psets import en, de diff --git a/src/ifcbimtester/bimtester/features/steps/application/en.py b/src/ifcbimtester/bimtester/features/steps/application/en.py new file mode 100644 index 0000000000..026d706973 --- /dev/null +++ b/src/ifcbimtester/bimtester/features/steps/application/en.py @@ -0,0 +1,47 @@ +from behave import step + +from bimtester.ifc import IfcStore +from bimtester.lang import _ + + +@step('The IFC file must be exported by application full name "{fullname}"') +def step_impl(context, fullname): + + real_fullname = IfcStore.file.by_type("IfcApplication")[0].ApplicationFullName + assert real_fullname == fullname , ( + "The IFC file was not exported by application full name {} " + "instead it was exported by application full name {}" + .format(fullname, real_fullname) + ) + + +@step('The IFC file must be exported by application identifier "{identifier}"') +def step_impl(context, identifier): + + real_identifier = IfcStore.file.by_type("IfcApplication")[0].ApplicationIdentifier + assert real_identifier == identifier , ( + "The IFC file was not exported by application identifier {} " + "instead it was exported by identifier {}" + .format(identifier, real_identifier) + ) + + +@step('The IFC file must be exported by the application version "{version}"') +def step_impl(context, version): + + real_version = IfcStore.file.by_type("IfcApplication")[0].Version + assert real_version == version , ( + "The IFC file was not exported by application version {} " + "instead it was exported by version {}" + .format(version, real_version) + ) + + +@step('IFC data header must have a file description of "{header_file_description}" such as the new Allplan IFC exporter creates it') +def step_impl(context, header_file_description): + + is_header_file_description = IfcStore.file.wrapped_data.header.file_description.description + assert str(is_header_file_description) == header_file_description , ( + "The file was not exported by the new ifc exporter in Allplan. File description header: {}" + .format(is_header_file_description) + ) diff --git a/src/ifcbimtester/examples/steps/application.py b/src/ifcbimtester/examples/steps/application.py deleted file mode 100644 index 84f1243e49..0000000000 --- a/src/ifcbimtester/examples/steps/application.py +++ /dev/null @@ -1,52 +0,0 @@ -import gettext -from behave import given -from behave import step - -from utils import IfcFile -from bimtester.ifc import IfcStore -from bimtester.lang import _ - - -@step("The IFC file must be exported by application full name {fullname}") -def step_impl(context, fullname): - - real_fullname = IfcStore.file.by_type("IfcApplication")[0].ApplicationFullName - assert real_fullname == fullname, ( - "The IFC file was not exported by application full name {} " - "instead it was exported by application full name {}".format(fullname, real_fullname) - ) - - -@step("The IFC file must be exported by application identifier {identifier}") -def step_impl(context, identifier): - - real_identifier = IfcStore.file.by_type("IfcApplication")[0].ApplicationIdentifier - assert ( - real_identifier == identifier - ), "The IFC file was not exported by application identifier {} " "instead it was exported by identifier {}".format( - identifier, real_identifier - ) - - -@step("The IFC file must be exported by the application version {version}") -def step_impl(context, version): - - real_version = IfcStore.file.by_type("IfcApplication")[0].Version - assert ( - real_version == version - ), "The IFC file was not exported by application version {} " "instead it was exported by version {}".format( - version, real_version - ) - - -@step( - "IFC data header must have a file description of {header_file_description} such as the new Allplan IFC exporter creates it" -) -def step_impl(context, header_file_description): - - is_header_file_description = IfcStore.file.wrapped_data.header.file_description.description - assert ( - str(is_header_file_description) == header_file_description - ), "The file was not exported by the new ifc exporter in Allplan. File description header: {}".format( - is_header_file_description - )