Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Jan 6, 2025
1 parent 09a09e4 commit e6d90ad
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit/test_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import unittest
from pyiron_ontology.parser import get_inputs_and_outputs
from pyiron_workflow import Workflow
from semantikon.typing import u


@Workflow.wrap.as_function_node("speed")
def calculate_speed(
distance: u(float, units="meter"),
time: u(float, units="second"),
) -> u(float, units="meter/second"):
return distance / time


class TestParser(unittest.TestCase):
def test_parser(self):
c = calculate_speed()
output_dict = get_inputs_and_outputs(c)
for label in ["input", "output", "function", "label"]:
self.assertIn(label, output_dict)


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

0 comments on commit e6d90ad

Please sign in to comment.