You can now create a new blank Brick project

This commit is contained in:
Dion Moult
2022-01-11 13:25:03 +11:00
parent f08ed629b5
commit c6966f9b39
8 changed files with 53 additions and 2 deletions
+6
View File
@@ -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)
+19
View File
@@ -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"