From ad504ff08198e2b985223ef11fc06503f2cd7924 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 21 Nov 2019 09:46:37 +1100 Subject: [PATCH] Add sentences to exempt IFC files from BIMTester auditing --- src/ifcbimtester/bimtester.py | 2 +- src/ifcbimtester/features/steps/steps.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ifcbimtester/bimtester.py b/src/ifcbimtester/bimtester.py index 52f5e72d11..90c5f3329d 100644 --- a/src/ifcbimtester/bimtester.py +++ b/src/ifcbimtester/bimtester.py @@ -58,7 +58,7 @@ class TestPurger: with open(filename, 'w') as new_file: for line in old_file: is_purged = False - if 'Given the IFC file ' in line: + if 'Given the IFC file ' in line and 'exists' not in line: filename = line.split('"')[1] print('Loading file {} ...'.format(filename)) self.file = ifcopenshell.open(filename) diff --git a/src/ifcbimtester/features/steps/steps.py b/src/ifcbimtester/features/steps/steps.py index a2abaf7411..219dff4a19 100644 --- a/src/ifcbimtester/features/steps/steps.py +++ b/src/ifcbimtester/features/steps/steps.py @@ -16,6 +16,10 @@ class IfcFile(object): def step_impl(context, file): IfcFile.load(file) +@given('the IFC file "{file}" exists') +def step_impl(context, file): + assert True + @given('that an IFC file is loaded') def step_impl(context): assert IfcFile.get() @@ -31,3 +35,7 @@ def step_impl(context, id, ifc_class): @then('the element {id} should not exist because {reason}') def step_impl(context, id, reason): assert not IfcFile.get().by_id(id) + +@then('the file is exempt from auditing because {reason}') +def step_impl(context, id, reason): + assert True