Skip to content

Commit

Permalink
test protected node attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Aug 29, 2024
1 parent 9fc2b31 commit a44e427
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_protected.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import znflow


class MyNode(znflow.Node):
_protected_ = znflow.Node._protected_ + ["a"]

a: int = 42
b: int = 42


def test_protected():
with znflow.DiGraph():
node = MyNode()
assert node.a == 42
assert isinstance(node.b, znflow.Connection)

0 comments on commit a44e427

Please sign in to comment.