mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
You can now create a new blank Brick project
This commit is contained in:
@@ -151,3 +151,9 @@ class TestConvertIfcToBrick:
|
||||
brick.get_convertable_brick_objects_and_elements().should_be_called().will_return([("obj", "element")])
|
||||
brick.get_brick_class("element").should_be_called().will_return(None)
|
||||
subject.convert_ifc_to_brick(brick, namespace="namespace", library="library")
|
||||
|
||||
|
||||
class TestNewBrickFile:
|
||||
def test_run(self, brick):
|
||||
brick.new_brick_file().should_be_called()
|
||||
subject.new_brick_file(brick)
|
||||
|
||||
@@ -298,6 +298,25 @@ class TestLoadBrickFile(NewFile):
|
||||
assert BrickStore.graph
|
||||
|
||||
|
||||
class TestNewBrickFile(NewFile):
|
||||
def test_run(self):
|
||||
# We stub the schema to make tests run faster
|
||||
BrickStore.schema = brickschema.Graph()
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
schema_path = os.path.join(cwd, "..", "files", "BrickStub.ttl")
|
||||
BrickStore.schema.load_file(schema_path)
|
||||
|
||||
# This is the actual test
|
||||
ns_alias = "digitaltwin"
|
||||
ns_uri = "https://example.org/digitaltwin#"
|
||||
subject.new_brick_file()
|
||||
assert BrickStore.graph
|
||||
for ns in BrickStore.graph.namespaces():
|
||||
if ns[0] == ns_alias and ns[1].toPython() == ns_uri:
|
||||
return
|
||||
assert False
|
||||
|
||||
|
||||
class TestPopBrickBreadcrumb(NewFile):
|
||||
def test_run(self):
|
||||
bpy.context.scene.BIMBrickProperties.brick_breadcrumbs.add().name = "foo"
|
||||
|
||||
Reference in New Issue
Block a user