Fix core/test_system.py (5de96c9)

This commit is contained in:
Andrej730
2025-11-03 18:32:54 +05:00
parent 30b74ab09c
commit 1599bc14b3
3 changed files with 33 additions and 5 deletions
+13
View File
@@ -485,6 +485,19 @@ class Georeference:
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
class Ifc:
def get(cls): pass
+7
View File
@@ -107,6 +107,13 @@ def georeference():
prophet.verify()
@pytest.fixture
def group():
prophet = Prophecy(bonsai.core.tool.Group)
yield prophet
prophet.verify()
@pytest.fixture
def library():
prophet = Prophecy(bonsai.core.tool.Library)
+13 -5
View File
@@ -18,7 +18,7 @@
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:
@@ -37,10 +37,17 @@ class TestDisableSystemEditingUI:
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()
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:
@@ -53,10 +60,11 @@ class TestEditSystem:
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()
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: