mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 20:02:30 +00:00
BIMTester UI updated to new Gherkin syntax conventions
This commit is contained in:
@@ -130,13 +130,17 @@ def get_subcontext(identifier, type, target_view):
|
|||||||
|
|
||||||
# Custom MicroMVD
|
# 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):
|
def step_impl(context, id, ifc_class):
|
||||||
assert IfcFile.get().by_id(id).is_a(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):
|
def step_impl(context, id, reason):
|
||||||
assert not IfcFile.get().by_id(id)
|
assert not IfcFile.get().by_id(id)
|
||||||
|
|
||||||
|
|||||||
@@ -335,9 +335,9 @@ class QAHelper():
|
|||||||
if 'Scenario: 'in source_line \
|
if 'Scenario: 'in source_line \
|
||||||
and bpy.context.scene.BIMProperties.scenario == source_line.strip()[len('Scenario: '):]:
|
and bpy.context.scene.BIMProperties.scenario == source_line.strip()[len('Scenario: '):]:
|
||||||
is_in_scenario = True
|
is_in_scenario = True
|
||||||
if is_in_scenario and source_line.strip()[0:4] == 'Then':
|
elif is_in_scenario:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
destination.write((' '*8) + line + '\n')
|
destination.write(line + '\n')
|
||||||
is_in_scenario = False
|
is_in_scenario = False
|
||||||
destination.write(source_line)
|
destination.write(source_line)
|
||||||
os.remove(filename+'~')
|
os.remove(filename+'~')
|
||||||
@@ -352,7 +352,7 @@ class ApproveClass(bpy.types.Operator):
|
|||||||
for object in bpy.context.selected_objects:
|
for object in bpy.context.selected_objects:
|
||||||
index = object.BIMObjectProperties.attributes.find('GlobalId')
|
index = object.BIMObjectProperties.attributes.find('GlobalId')
|
||||||
if index != -1:
|
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.BIMObjectProperties.attributes[index].string_value,
|
||||||
object.name.split('/')[0]))
|
object.name.split('/')[0]))
|
||||||
QAHelper.append_to_scenario(lines)
|
QAHelper.append_to_scenario(lines)
|
||||||
@@ -366,7 +366,7 @@ class RejectClass(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
lines = []
|
lines = []
|
||||||
for object in bpy.context.selected_objects:
|
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[
|
||||||
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
|
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
|
||||||
bpy.context.scene.BIMProperties.audit_ifc_class))
|
bpy.context.scene.BIMProperties.audit_ifc_class))
|
||||||
@@ -381,7 +381,7 @@ class RejectElement(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
lines = []
|
lines = []
|
||||||
for object in bpy.context.selected_objects:
|
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[
|
||||||
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
|
object.BIMObjectProperties.attributes.find('GlobalId')].string_value,
|
||||||
bpy.context.scene.BIMProperties.qa_reject_element_reason))
|
bpy.context.scene.BIMProperties.qa_reject_element_reason))
|
||||||
|
|||||||
Reference in New Issue
Block a user