mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
ifcmcp: fix tests to use IfcSession directly
Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
|
import pytest
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.api.aggregate
|
import ifcopenshell.api.aggregate
|
||||||
import ifcopenshell.api.owner.settings
|
import ifcopenshell.api.owner.settings
|
||||||
@@ -6,14 +7,18 @@ import ifcopenshell.api.project
|
|||||||
import ifcopenshell.api.root
|
import ifcopenshell.api.root
|
||||||
import ifcopenshell.api.spatial
|
import ifcopenshell.api.spatial
|
||||||
import ifcopenshell.api.unit
|
import ifcopenshell.api.unit
|
||||||
import pytest
|
|
||||||
|
|
||||||
import ifcmcp.server as server_mod
|
from ifcmcp.core import IfcSession
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def session():
|
||||||
|
return IfcSession()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def model():
|
def model():
|
||||||
"""Create an IFC4 model with a spatial hierarchy, a wall, and a slab."""
|
"""IFC4 model with a spatial hierarchy, a wall, and a slab."""
|
||||||
f = ifcopenshell.api.project.create_file()
|
f = ifcopenshell.api.project.create_file()
|
||||||
ifcopenshell.api.owner.settings.get_user = lambda ifc: (ifc.by_type("IfcPersonAndOrganization") or [None])[0]
|
ifcopenshell.api.owner.settings.get_user = lambda ifc: (ifc.by_type("IfcPersonAndOrganization") or [None])[0]
|
||||||
ifcopenshell.api.owner.settings.get_application = lambda ifc: (ifc.by_type("IfcApplication") or [None])[0]
|
ifcopenshell.api.owner.settings.get_application = lambda ifc: (ifc.by_type("IfcApplication") or [None])[0]
|
||||||
@@ -46,19 +51,9 @@ def model_file(model, tmp_path):
|
|||||||
return str(path)
|
return str(path)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def reset_server_state():
|
|
||||||
"""Reset module-level state before each test."""
|
|
||||||
server_mod._model = None
|
|
||||||
server_mod._model_path = None
|
|
||||||
yield
|
|
||||||
server_mod._model = None
|
|
||||||
server_mod._model_path = None
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def loaded_model(model):
|
def loaded_session(model):
|
||||||
"""Set the server module state to an in-memory model (no file path)."""
|
"""An IfcSession with an in-memory model already loaded (no file path)."""
|
||||||
server_mod._model = model
|
s = IfcSession()
|
||||||
server_mod._model_path = None
|
s.model = model
|
||||||
return model
|
return s
|
||||||
|
|||||||
@@ -1,99 +1,95 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
import ifcopenshell
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ifcmcp.server import ifc_docs, ifc_edit, ifc_list
|
from ifcmcp.core import IfcSession, IfcSessionError
|
||||||
|
|
||||||
|
|
||||||
class TestNoModel:
|
class TestNoModel:
|
||||||
def test_edit_no_model(self):
|
def test_edit_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_edit("root.create_entity")
|
session.ifc_edit("root.create_entity")
|
||||||
|
|
||||||
|
|
||||||
class TestList:
|
class TestList:
|
||||||
def test_list_all_modules(self, loaded_model):
|
def test_list_all_modules(self, loaded_session):
|
||||||
result = ifc_list()
|
result = loaded_session.ifc_list()
|
||||||
assert isinstance(result, list)
|
assert isinstance(result, list)
|
||||||
assert len(result) > 0
|
assert len(result) > 0
|
||||||
modules = [m["module"] for m in result]
|
modules = [m["module"] for m in result]
|
||||||
assert "root" in modules
|
assert "root" in modules
|
||||||
assert "spatial" in modules
|
assert "spatial" in modules
|
||||||
|
|
||||||
def test_list_module_functions(self, loaded_model):
|
def test_list_module_functions(self, loaded_session):
|
||||||
result = ifc_list(module="root")
|
result = loaded_session.ifc_list(module="root")
|
||||||
assert isinstance(result, list)
|
assert isinstance(result, list)
|
||||||
names = [f["name"] for f in result]
|
names = [f["name"] for f in result]
|
||||||
assert "create_entity" in names
|
assert "create_entity" in names
|
||||||
|
|
||||||
def test_list_empty_string_returns_modules(self, loaded_model):
|
def test_list_empty_string_returns_modules(self, loaded_session):
|
||||||
result = ifc_list(module="")
|
result = loaded_session.ifc_list(module="")
|
||||||
assert isinstance(result, list)
|
assert isinstance(result, list)
|
||||||
assert any(m["module"] == "root" for m in result)
|
assert any(m["module"] == "root" for m in result)
|
||||||
|
|
||||||
|
|
||||||
class TestDocs:
|
class TestDocs:
|
||||||
def test_docs_create_entity(self, loaded_model):
|
def test_docs_create_entity(self, loaded_session):
|
||||||
result = ifc_docs("root.create_entity")
|
result = loaded_session.ifc_docs("root.create_entity")
|
||||||
assert result["module"] == "root"
|
assert result["module"] == "root"
|
||||||
assert result["function"] == "create_entity"
|
assert result["function"] == "create_entity"
|
||||||
assert "params" in result
|
assert "params" in result
|
||||||
|
|
||||||
def test_docs_bad_format(self, loaded_model):
|
def test_docs_bad_format(self, loaded_session):
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
ifc_docs("no_dot_here")
|
loaded_session.ifc_docs("no_dot_here")
|
||||||
|
|
||||||
|
|
||||||
class TestEdit:
|
class TestEdit:
|
||||||
def test_create_entity(self, loaded_model):
|
def test_create_entity(self, loaded_session):
|
||||||
result = ifc_edit("root.create_entity", json.dumps({"ifc_class": "IfcWall", "name": "NewWall"}))
|
result = loaded_session.ifc_edit("root.create_entity", json.dumps({"ifc_class": "IfcWall", "name": "NewWall"}))
|
||||||
assert result["ok"] is True
|
assert result["ok"] is True
|
||||||
assert result["result"]["type"] == "IfcWall"
|
assert result["result"]["type"] == "IfcWall"
|
||||||
assert result["result"]["name"] == "NewWall"
|
assert result["result"]["name"] == "NewWall"
|
||||||
|
|
||||||
def test_create_entity_default_params(self, loaded_model):
|
def test_create_entity_default_params(self, loaded_session):
|
||||||
result = ifc_edit("root.create_entity", "{}")
|
result = loaded_session.ifc_edit("root.create_entity", "{}")
|
||||||
assert result["ok"] is True
|
assert result["ok"] is True
|
||||||
|
|
||||||
def test_unknown_function(self, loaded_model):
|
def test_unknown_function(self, loaded_session):
|
||||||
result = ifc_edit("root.nonexistent", "{}")
|
result = loaded_session.ifc_edit("root.nonexistent", "{}")
|
||||||
assert result["ok"] is False
|
assert result["ok"] is False
|
||||||
assert "Cannot find" in result["error"]
|
assert "Cannot find" in result["error"]
|
||||||
|
|
||||||
def test_unknown_parameter(self, loaded_model):
|
def test_unknown_parameter(self, loaded_session):
|
||||||
result = ifc_edit("root.create_entity", json.dumps({"bogus": "value"}))
|
result = loaded_session.ifc_edit("root.create_entity", json.dumps({"bogus": "value"}))
|
||||||
assert result["ok"] is False
|
assert result["ok"] is False
|
||||||
assert "Unknown parameter" in result["error"]
|
assert "Unknown parameter" in result["error"]
|
||||||
|
|
||||||
def test_bad_json(self, loaded_model):
|
def test_bad_json(self, loaded_session):
|
||||||
with pytest.raises(json.JSONDecodeError):
|
with pytest.raises(json.JSONDecodeError):
|
||||||
ifc_edit("root.create_entity", "not json")
|
loaded_session.ifc_edit("root.create_entity", "not json")
|
||||||
|
|
||||||
def test_edit_does_not_save(self, loaded_model, tmp_path):
|
def test_edit_does_not_save(self, loaded_session, tmp_path):
|
||||||
"""Verify that ifc_edit mutates the in-memory model but does not write to disk."""
|
"""Verify that ifc_edit mutates the in-memory model but does not write to disk."""
|
||||||
import ifcmcp.server as server_mod
|
|
||||||
|
|
||||||
path = str(tmp_path / "test.ifc")
|
path = str(tmp_path / "test.ifc")
|
||||||
loaded_model.write(path)
|
loaded_session.model.write(path)
|
||||||
server_mod._model_path = path
|
loaded_session.model_path = path
|
||||||
|
|
||||||
before_count = sum(1 for _ in loaded_model)
|
before_count = sum(1 for _ in loaded_session.model)
|
||||||
ifc_edit("root.create_entity", json.dumps({"ifc_class": "IfcWall", "name": "Unsaved"}))
|
loaded_session.ifc_edit("root.create_entity", json.dumps({"ifc_class": "IfcWall", "name": "Unsaved"}))
|
||||||
after_count = sum(1 for _ in loaded_model)
|
after_count = sum(1 for _ in loaded_session.model)
|
||||||
assert after_count == before_count + 1
|
assert after_count == before_count + 1
|
||||||
|
|
||||||
# Re-read the file — it should not have the new entity
|
|
||||||
import ifcopenshell
|
|
||||||
|
|
||||||
on_disk = ifcopenshell.open(path)
|
on_disk = ifcopenshell.open(path)
|
||||||
disk_count = sum(1 for _ in on_disk)
|
disk_count = sum(1 for _ in on_disk)
|
||||||
assert disk_count == before_count
|
assert disk_count == before_count
|
||||||
|
|
||||||
def test_assign_container(self, loaded_model):
|
def test_assign_container(self, loaded_session):
|
||||||
wall = loaded_model.by_type("IfcWall")[0]
|
wall = loaded_session.model.by_type("IfcWall")[0]
|
||||||
storey = loaded_model.by_type("IfcBuildingStorey")[0]
|
storey = loaded_session.model.by_type("IfcBuildingStorey")[0]
|
||||||
result = ifc_edit(
|
result = loaded_session.ifc_edit(
|
||||||
"spatial.assign_container",
|
"spatial.assign_container",
|
||||||
json.dumps({"products": str(wall.id()), "relating_structure": str(storey.id())}),
|
json.dumps({"products": str(wall.id()), "relating_structure": str(storey.id())}),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ifcmcp.server import ifc_info, ifc_relations, ifc_select, ifc_summary, ifc_tree
|
from ifcmcp.core import IfcSessionError
|
||||||
|
|
||||||
|
|
||||||
class TestNoModel:
|
class TestNoModel:
|
||||||
"""All query tools should fail when no model is loaded."""
|
"""All query tools should fail when no model is loaded."""
|
||||||
|
|
||||||
def test_summary_no_model(self):
|
def test_summary_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_summary()
|
session.ifc_summary()
|
||||||
|
|
||||||
def test_tree_no_model(self):
|
def test_tree_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_tree()
|
session.ifc_tree()
|
||||||
|
|
||||||
def test_info_no_model(self):
|
def test_info_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_info(1)
|
session.ifc_info(1)
|
||||||
|
|
||||||
def test_select_no_model(self):
|
def test_select_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_select("IfcWall")
|
session.ifc_select("IfcWall")
|
||||||
|
|
||||||
def test_relations_no_model(self):
|
def test_relations_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_relations(1)
|
session.ifc_relations(1)
|
||||||
|
|
||||||
|
|
||||||
class TestSummary:
|
class TestSummary:
|
||||||
def test_schema(self, loaded_model):
|
def test_schema(self, loaded_session):
|
||||||
result = ifc_summary()
|
result = loaded_session.ifc_summary()
|
||||||
assert result["schema"] == "IFC4"
|
assert result["schema"] == "IFC4"
|
||||||
|
|
||||||
def test_total_entities(self, loaded_model):
|
def test_total_entities(self, loaded_session):
|
||||||
result = ifc_summary()
|
result = loaded_session.ifc_summary()
|
||||||
assert result["total_entities"] > 0
|
assert result["total_entities"] > 0
|
||||||
|
|
||||||
def test_project_name(self, loaded_model):
|
def test_project_name(self, loaded_session):
|
||||||
result = ifc_summary()
|
result = loaded_session.ifc_summary()
|
||||||
assert result["project"]["name"] == "TestProject"
|
assert result["project"]["name"] == "TestProject"
|
||||||
|
|
||||||
def test_type_counts(self, loaded_model):
|
def test_type_counts(self, loaded_session):
|
||||||
result = ifc_summary()
|
result = loaded_session.ifc_summary()
|
||||||
assert result["types"]["IfcWall"] == 1
|
assert result["types"]["IfcWall"] == 1
|
||||||
assert result["types"]["IfcSlab"] == 1
|
assert result["types"]["IfcSlab"] == 1
|
||||||
|
|
||||||
|
|
||||||
class TestTree:
|
class TestTree:
|
||||||
def test_root_is_project(self, loaded_model):
|
def test_root_is_project(self, loaded_session):
|
||||||
result = ifc_tree()
|
result = loaded_session.ifc_tree()
|
||||||
assert result["type"] == "IfcProject"
|
assert result["type"] == "IfcProject"
|
||||||
assert result["name"] == "TestProject"
|
assert result["name"] == "TestProject"
|
||||||
|
|
||||||
def test_hierarchy_depth(self, loaded_model):
|
def test_hierarchy_depth(self, loaded_session):
|
||||||
result = ifc_tree()
|
result = loaded_session.ifc_tree()
|
||||||
site = result["children"][0]
|
site = result["children"][0]
|
||||||
assert site["type"] == "IfcSite"
|
assert site["type"] == "IfcSite"
|
||||||
building = site["children"][0]
|
building = site["children"][0]
|
||||||
@@ -64,50 +64,50 @@ class TestTree:
|
|||||||
|
|
||||||
|
|
||||||
class TestInfo:
|
class TestInfo:
|
||||||
def test_wall_info(self, loaded_model):
|
def test_wall_info(self, loaded_session):
|
||||||
wall = loaded_model.by_type("IfcWall")[0]
|
wall = loaded_session.model.by_type("IfcWall")[0]
|
||||||
result = ifc_info(wall.id())
|
result = loaded_session.ifc_info(wall.id())
|
||||||
assert result["id"] == wall.id()
|
assert result["id"] == wall.id()
|
||||||
assert result["type"] == "IfcWall"
|
assert result["type"] == "IfcWall"
|
||||||
|
|
||||||
def test_invalid_id(self, loaded_model):
|
def test_invalid_id(self, loaded_session):
|
||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
ifc_info(999999)
|
loaded_session.ifc_info(999999)
|
||||||
|
|
||||||
|
|
||||||
class TestSelect:
|
class TestSelect:
|
||||||
def test_select_walls(self, loaded_model):
|
def test_select_walls(self, loaded_session):
|
||||||
result = ifc_select("IfcWall")
|
result = loaded_session.ifc_select("IfcWall")
|
||||||
assert len(result) == 1
|
assert len(result) == 1
|
||||||
assert result[0]["type"] == "IfcWall"
|
assert result[0]["type"] == "IfcWall"
|
||||||
assert result[0]["name"] == "Wall001"
|
assert result[0]["name"] == "Wall001"
|
||||||
|
|
||||||
def test_select_slabs(self, loaded_model):
|
def test_select_slabs(self, loaded_session):
|
||||||
result = ifc_select("IfcSlab")
|
result = loaded_session.ifc_select("IfcSlab")
|
||||||
assert len(result) == 1
|
assert len(result) == 1
|
||||||
assert result[0]["name"] == "Slab001"
|
assert result[0]["name"] == "Slab001"
|
||||||
|
|
||||||
def test_select_no_match(self, loaded_model):
|
def test_select_no_match(self, loaded_session):
|
||||||
result = ifc_select("IfcWindow")
|
result = loaded_session.ifc_select("IfcWindow")
|
||||||
assert result == []
|
assert result == []
|
||||||
|
|
||||||
|
|
||||||
class TestRelations:
|
class TestRelations:
|
||||||
def test_wall_relations(self, loaded_model):
|
def test_wall_relations(self, loaded_session):
|
||||||
wall = loaded_model.by_type("IfcWall")[0]
|
wall = loaded_session.model.by_type("IfcWall")[0]
|
||||||
result = ifc_relations(wall.id())
|
result = loaded_session.ifc_relations(wall.id())
|
||||||
assert result["id"] == wall.id()
|
assert result["id"] == wall.id()
|
||||||
assert result["type"] == "IfcWall"
|
assert result["type"] == "IfcWall"
|
||||||
assert "hierarchy" in result
|
assert "hierarchy" in result
|
||||||
|
|
||||||
def test_traverse_up(self, loaded_model):
|
def test_traverse_up(self, loaded_session):
|
||||||
wall = loaded_model.by_type("IfcWall")[0]
|
wall = loaded_session.model.by_type("IfcWall")[0]
|
||||||
result = ifc_relations(wall.id(), traverse="up")
|
result = loaded_session.ifc_relations(wall.id(), traverse="up")
|
||||||
assert isinstance(result, list)
|
assert isinstance(result, list)
|
||||||
assert result[0]["type"] == "IfcWall"
|
assert result[0]["type"] == "IfcWall"
|
||||||
assert result[-1]["type"] == "IfcProject"
|
assert result[-1]["type"] == "IfcProject"
|
||||||
|
|
||||||
def test_traverse_empty_string_means_no_traverse(self, loaded_model):
|
def test_traverse_empty_string_means_no_traverse(self, loaded_session):
|
||||||
wall = loaded_model.by_type("IfcWall")[0]
|
wall = loaded_session.model.by_type("IfcWall")[0]
|
||||||
result = ifc_relations(wall.id(), traverse="")
|
result = loaded_session.ifc_relations(wall.id(), traverse="")
|
||||||
assert isinstance(result, dict)
|
assert isinstance(result, dict)
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
from ifcmcp.server import server
|
from ifcmcp.server import build_server
|
||||||
|
|
||||||
|
|
||||||
class TestServerRegistration:
|
class TestServerRegistration:
|
||||||
def test_server_name(self):
|
def test_server_name(self):
|
||||||
|
server = build_server()
|
||||||
assert server.name == "ifc-mcp"
|
assert server.name == "ifc-mcp"
|
||||||
|
|
||||||
def test_all_tools_registered(self):
|
def test_all_tools_registered(self):
|
||||||
|
server = build_server()
|
||||||
tools = [t.name for t in server._tool_manager.list_tools()]
|
tools = [t.name for t in server._tool_manager.list_tools()]
|
||||||
expected = [
|
expected = [
|
||||||
"ifc_load",
|
"ifc_load",
|
||||||
@@ -23,7 +25,3 @@ class TestServerRegistration:
|
|||||||
]
|
]
|
||||||
for name in expected:
|
for name in expected:
|
||||||
assert name in tools, f"Tool {name} not registered"
|
assert name in tools, f"Tool {name} not registered"
|
||||||
|
|
||||||
def test_tool_count(self):
|
|
||||||
tools = server._tool_manager.list_tools()
|
|
||||||
assert len(tools) == 11
|
|
||||||
|
|||||||
@@ -1,46 +1,44 @@
|
|||||||
# This file was generated with the assistance of an AI coding tool.
|
# This file was generated with the assistance of an AI coding tool.
|
||||||
|
import ifcopenshell
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import ifcmcp.server as server_mod
|
from ifcmcp.core import IfcSession, IfcSessionError
|
||||||
from ifcmcp.server import ifc_load, ifc_save
|
|
||||||
|
|
||||||
|
|
||||||
class TestLoad:
|
class TestLoad:
|
||||||
def test_load_file(self, model_file):
|
def test_load_file(self, session, model_file):
|
||||||
result = ifc_load(model_file)
|
result = session.ifc_load(model_file)
|
||||||
assert "IFC4" in result
|
assert "IFC4" in result
|
||||||
assert server_mod._model is not None
|
assert session.model is not None
|
||||||
assert server_mod._model_path == model_file
|
assert session.model_path == model_file
|
||||||
|
|
||||||
def test_load_sets_entity_count(self, model_file):
|
def test_load_sets_entity_count(self, session, model_file):
|
||||||
result = ifc_load(model_file)
|
result = session.ifc_load(model_file)
|
||||||
assert "entities" in result
|
assert "entities" in result
|
||||||
|
|
||||||
def test_load_nonexistent_file(self):
|
def test_load_nonexistent_file(self, session):
|
||||||
with pytest.raises(Exception):
|
with pytest.raises(Exception):
|
||||||
ifc_load("/nonexistent/path/model.ifc")
|
session.ifc_load("/nonexistent/path/model.ifc")
|
||||||
|
|
||||||
|
|
||||||
class TestSave:
|
class TestSave:
|
||||||
def test_save_no_model(self):
|
def test_save_no_model(self, session):
|
||||||
with pytest.raises(ValueError, match="No model loaded"):
|
with pytest.raises(IfcSessionError, match="No model loaded"):
|
||||||
ifc_save()
|
session.ifc_save()
|
||||||
|
|
||||||
def test_save_overwrites_original(self, model_file):
|
def test_save_overwrites_original(self, session, model_file):
|
||||||
ifc_load(model_file)
|
session.ifc_load(model_file)
|
||||||
result = ifc_save()
|
result = session.ifc_save()
|
||||||
assert model_file in result
|
assert model_file in result
|
||||||
|
|
||||||
def test_save_to_new_path(self, model_file, tmp_path):
|
def test_save_to_new_path(self, session, model_file, tmp_path):
|
||||||
ifc_load(model_file)
|
session.ifc_load(model_file)
|
||||||
new_path = str(tmp_path / "output.ifc")
|
new_path = str(tmp_path / "output.ifc")
|
||||||
result = ifc_save(new_path)
|
result = session.ifc_save(new_path)
|
||||||
assert new_path in result
|
assert new_path in result
|
||||||
import ifcopenshell
|
|
||||||
|
|
||||||
reloaded = ifcopenshell.open(new_path)
|
reloaded = ifcopenshell.open(new_path)
|
||||||
assert reloaded.schema == "IFC4"
|
assert reloaded.schema == "IFC4"
|
||||||
|
|
||||||
def test_save_no_path_no_original(self, loaded_model):
|
def test_save_no_path_no_original(self, loaded_session):
|
||||||
with pytest.raises(ValueError, match="No path specified"):
|
with pytest.raises(IfcSessionError, match="No path specified"):
|
||||||
ifc_save()
|
loaded_session.ifc_save()
|
||||||
|
|||||||
Reference in New Issue
Block a user