diff --git a/tests/static/nodes_subpackage/subsub_sibling/__init__.py b/tests/static/nodes_subpackage/subsub_sibling/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/static/nodes_subpackage/subsub_sibling/demo_nodes.py b/tests/static/nodes_subpackage/subsub_sibling/demo_nodes.py new file mode 100644 index 00000000..533e1005 --- /dev/null +++ b/tests/static/nodes_subpackage/subsub_sibling/demo_nodes.py @@ -0,0 +1,16 @@ +""" +A demo node package for the purpose of testing node package registration. +""" + +from typing import Optional + +from pyiron_workflow import Workflow + + +@Workflow.wrap_as.single_value_node("sum") +def OptionallyAdd(x: int, y: Optional[int] = None) -> int: + y = 0 if y is None else y + return x + y + + +nodes = [OptionallyAdd] diff --git a/tests/unit/test_interfaces.py b/tests/unit/test_interfaces.py index 87442fa1..4281ed4d 100644 --- a/tests/unit/test_interfaces.py +++ b/tests/unit/test_interfaces.py @@ -44,6 +44,7 @@ def test_registration(self): self.creator.register("static.nodes_subpackage", "sub") self.assertIsInstance(self.creator.sub.demo_nodes, NodePackage) self.assertIsInstance(self.creator.sub.subsub_package.demo_nodes, NodePackage) + self.assertIsInstance(self.creator.sub.subsub_sibling.demo_nodes, NodePackage) with self.subTest("Test re-registration"): self.creator.register("static.demo_nodes", "demo")