mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 08:33:10 +00:00
Fix core/test_system.py (5de96c9)
This commit is contained in:
@@ -485,6 +485,19 @@ class Georeference:
|
|||||||
def xyz2enh(cls, coordinates): pass
|
def xyz2enh(cls, coordinates): pass
|
||||||
|
|
||||||
|
|
||||||
|
@interface
|
||||||
|
class Group:
|
||||||
|
def get_group_props(cls): pass
|
||||||
|
def get_groups_data(cls, group_type): pass
|
||||||
|
def import_groups(cls, group_type): pass
|
||||||
|
def enable_group_editing_ui(cls) : pass
|
||||||
|
def disable_group_editing_ui(cls): pass
|
||||||
|
def disable_editing_group(cls): pass
|
||||||
|
def set_active_group_to_edit(cls, group): pass
|
||||||
|
def toggle_group(cls, group, group_type, option): pass
|
||||||
|
def update_uilist_index(cls, group_type): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
class Ifc:
|
class Ifc:
|
||||||
def get(cls): pass
|
def get(cls): pass
|
||||||
|
|||||||
@@ -107,6 +107,13 @@ def georeference():
|
|||||||
prophet.verify()
|
prophet.verify()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def group():
|
||||||
|
prophet = Prophecy(bonsai.core.tool.Group)
|
||||||
|
yield prophet
|
||||||
|
prophet.verify()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def library():
|
def library():
|
||||||
prophet = Prophecy(bonsai.core.tool.Library)
|
prophet = Prophecy(bonsai.core.tool.Library)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import bonsai.core.system as subject
|
import bonsai.core.system as subject
|
||||||
from test.core.bootstrap import ifc, system, spatial
|
from test.core.bootstrap import ifc, system, spatial, group
|
||||||
|
|
||||||
|
|
||||||
class TestLoadSystems:
|
class TestLoadSystems:
|
||||||
@@ -37,10 +37,17 @@ class TestDisableSystemEditingUI:
|
|||||||
|
|
||||||
|
|
||||||
class TestAddSystem:
|
class TestAddSystem:
|
||||||
def test_run(self, ifc, system):
|
def test_run(self, ifc, group, system):
|
||||||
ifc.run("system.add_system", ifc_class="ifc_class").should_be_called()
|
ifc.run("system.add_system", ifc_class="ifc_class").should_be_called()
|
||||||
system.import_systems().should_be_called()
|
system.import_systems().should_be_called()
|
||||||
subject.add_system(ifc, system, ifc_class="ifc_class")
|
subject.add_system(ifc, group, system, ifc_class="ifc_class", parent_system=None)
|
||||||
|
|
||||||
|
def test_run_with_parent_system(self, ifc, group, system):
|
||||||
|
ifc.run("system.add_system", ifc_class="ifc_class").should_be_called().will_return("new_system")
|
||||||
|
ifc.run("group.assign_group", products=["new_system"], group="parent_system").should_be_called()
|
||||||
|
group.toggle_group("parent_system", "IfcSystem", "EXPAND").should_be_called()
|
||||||
|
system.import_systems().should_be_called()
|
||||||
|
subject.add_system(ifc, group, system, ifc_class="ifc_class", parent_system="parent_system")
|
||||||
|
|
||||||
|
|
||||||
class TestEditSystem:
|
class TestEditSystem:
|
||||||
@@ -53,10 +60,11 @@ class TestEditSystem:
|
|||||||
|
|
||||||
|
|
||||||
class TestRemoveSystem:
|
class TestRemoveSystem:
|
||||||
def test_run(self, ifc, system):
|
def test_run(self, ifc, group, system):
|
||||||
ifc.run("system.remove_system", system="system").should_be_called()
|
ifc.run("system.remove_system", system="system").should_be_called()
|
||||||
system.import_systems().should_be_called()
|
system.import_systems().should_be_called()
|
||||||
subject.remove_system(ifc, system, system="system")
|
group.update_uilist_index("IfcSystem").should_be_called()
|
||||||
|
subject.remove_system(ifc, group, system, system="system")
|
||||||
|
|
||||||
|
|
||||||
class TestEnableEditingSystem:
|
class TestEnableEditingSystem:
|
||||||
|
|||||||
Reference in New Issue
Block a user