BIMTester UI updated to new Gherkin syntax conventions

This commit is contained in:
Dion Moult
2020-07-14 18:22:32 +10:00
parent 98ed21a1e2
commit 1222716e16
2 changed files with 11 additions and 7 deletions
+6 -2
View File
@@ -130,13 +130,17 @@ def get_subcontext(identifier, type, target_view):
# Custom MicroMVD
@step('The element {id} is an {ifc_class} only')
def step_impl(context, id, ifc_class):
assert IfcFile.get().by_id(id).is_a() == ifc_class
@step('the element {id} is an {ifc_class}')
@step('The element {id} is an {ifc_class}')
def step_impl(context, id, ifc_class):
assert IfcFile.get().by_id(id).is_a(ifc_class)
@step('the element {id} should not exist because {reason}')
@step('The element {id} should not exist because {reason}')
def step_impl(context, id, reason):
assert not IfcFile.get().by_id(id)
@@ -335,9 +335,9 @@ class QAHelper():
if 'Scenario: 'in source_line \
and bpy.context.scene.BIMProperties.scenario == source_line.strip()[len('Scenario: '):]:
is_in_scenario = True
if is_in_scenario and source_line.strip()[0:4] == 'Then':
elif is_in_scenario:
for line in lines:
destination.write((' '*8) + line + '\n')
destination.write(line + '\n')
is_in_scenario = False
destination.write(source_line)
os.remove(filename+'~')
@@ -352,7 +352,7 @@ class ApproveClass(bpy.types.Operator):
for object in bpy.context.selected_objects:
index = object.BIMObjectProperties.attributes.find('GlobalId')
if index != -1:
lines.append('Then the element {} is an {}'.format(
lines.append(' * The element {} is an {}'.format(
object.BIMObjectProperties.attributes[index].string_value,
object.name.split('/')[0]))
QAHelper.append_to_scenario(lines)
@@ -366,7 +366,7 @@ class RejectClass(bpy.types.Operator):
def execute(self, context):
lines = []
for object in bpy.context.selected_objects:
lines.append('Then the element {} is an {}'.format(
lines.append(' * The element {} is an {}'.format(
object.BIMObjectProperties.attributes[
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
bpy.context.scene.BIMProperties.audit_ifc_class))
@@ -381,7 +381,7 @@ class RejectElement(bpy.types.Operator):
def execute(self, context):
lines = []
for object in bpy.context.selected_objects:
lines.append('Then the element {} should not exist because {}'.format(
lines.append(' * The element {} should not exist because {}'.format(
object.BIMObjectProperties.attributes[
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
bpy.context.scene.BIMProperties.qa_reject_element_reason))