Skip to content

Commit

Permalink
Add test file
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Jan 25, 2025
1 parent 88ab6fd commit d71e4d4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/unit/test_hash_based_storage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import unittest
from pyiron_nodes.development import hash_based_storage
from pyiron_workflow import Workflow


@Workflow.wrap.as_function_node("result")
def add(x, z):
return x + z

@Workflow.wrap.as_function_node("result")
def multiply(z, y):
return z * y


class TestHashBasedStorage(unittest.TestCase):
def test_extract_node_input(self):
a = add(1, 2)
m = multiply(a, 3)
d = hash_based_storage.extract_node_input(m)
self.assertTrue("z" in d)
self.assertTrue("y" in d)
self.assertEqual(d["y"], "3")
self.assertTrue(d["z"].startswith("hash"))


if __name__ == '__main__':
unittest.main()

0 comments on commit d71e4d4

Please sign in to comment.