mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Fix failing tests and optimise brick tests.
This commit is contained in:
@@ -24,6 +24,7 @@ import ifcopenshell
|
||||
import blenderbim.tool as tool
|
||||
import blenderbim.bim
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
from blenderbim.tool.brick import BrickStore
|
||||
from blenderbim.bim.module.model.data import AuthoringData
|
||||
from pytest_bdd import scenarios, given, when, then, parsers
|
||||
from mathutils import Vector
|
||||
@@ -71,6 +72,8 @@ def an_empty_blender_session():
|
||||
if len(bpy.data.objects) > 0:
|
||||
bpy.data.batch_remove(bpy.data.objects)
|
||||
bpy.ops.outliner.orphans_purge(do_local_ids=True, do_linked_ids=True, do_recursive=True)
|
||||
if len(bpy.data.materials) > 0:
|
||||
bpy.data.batch_remove(bpy.data.materials)
|
||||
|
||||
# default project settings
|
||||
bpy.context.scene.unit_settings.system = "METRIC"
|
||||
@@ -92,6 +95,13 @@ def an_empty_ifc_2x3_project():
|
||||
bpy.ops.bim.create_project()
|
||||
|
||||
|
||||
@given("the Brickschema is stubbed")
|
||||
def the_brickschema_is_stubbed():
|
||||
# This makes things run faster since we don't need to load the entire brick schema
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
BrickStore.schema = os.path.join(cwd, "..", "files", "BrickStub.ttl")
|
||||
|
||||
|
||||
@when("I load a new pset template file")
|
||||
def i_load_a_new_pset_template_file():
|
||||
IfcStore.pset_template_path = bpy.context.scene.BIMPsetTemplateProperties.pset_template_files
|
||||
|
||||
Reference in New Issue
Block a user