Skip to content

Add unit tests for filename input handling across all workflow frameworks#182

Merged
jan-janssen merged 4 commits into
mainfrom
copilot/add-unit-test-file-name-input
May 14, 2026
Merged

Add unit tests for filename input handling across all workflow frameworks#182
jan-janssen merged 4 commits into
mainfrom
copilot/add-unit-test-file-name-input

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

Summary

Adds unit tests verifying that all workflow frameworks correctly treat input values containing dots — such as "image.png" — as plain strings, without mistaking them for Python module paths or floating-point numbers. This tests the recently-added guard condition nodes_types_dict[int(k)] == "function" and isinstance(v, str) and "." in v present in every framework's load_workflow_json.

Changes

tests/test_models.py

  • Extended test_input_node_valid_values to include "image.png" and "path/to/file.tar.gz" alongside existing values.
  • Added test_input_node_filename_value_roundtrip: verifies that dotted filenames (image.png, archive.tar.gz, report.2024.pdf, data.csv) survive model construction → model_dumpmodel_validate round-trips intact.
  • Added test_workflow_with_filename_input_roundtrip: verifies a full workflow containing "image.png" as an input node value serialises and deserialises correctly through dump_json / load_json_str.

tests/test_purepython.py

  • Added test_purepython_filename_input: writes an echo function module + workflow JSON with "image.png" as input, runs via load_workflow_json, and asserts the result is the string "image.png".
  • Added test_purepython_filename_input_multiple_dots: same test with "archive.tar.gz" to cover multi-dot filenames.

tests/test_executorlib.py

  • Added test_executorlib_filename_input: same echo-function round-trip as purepython, executed through SingleNodeExecutor.

tests/test_jobflow.py

  • Added test_jobflow_filename_input: creates a single-job flow with filename="image.png", writes the workflow JSON, verifies the JSON contains "image.png" as an input value, then loads, runs, and asserts the job output equals "image.png".

tests/test_pyiron_base.py

  • Added test_pyiron_base_filename_input: same write → inspect JSON → load → pull() round-trip for the pyiron_base delayed-object framework.

tests/test_pyiron_workflow.py

  • Added test_pyiron_workflow_filename_input: writes workflow JSON with "image.png" directly, loads it, and runs the workflow.
  • Added test_pyiron_workflow_filename_input_programmatic: creates a workflow programmatically using to_function_node, saves with write_workflow_json, verifies the JSON contains "image.png", then reloads with load_workflow_json and runs.

.gitignore

  • Added patterns for all test-generated runtime files to prevent them from being tracked in future.

Notes

  • No production code was modified.
  • Tests for frameworks with optional dependencies (executorlib, jobflow, pyiron_base, pyiron_workflow) require those packages to be installed; the models/shared/purepython tests run without any optional dependencies and are verified passing.

Removed test-generated temporary files from .gitignore.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jan-janssen jan-janssen marked this pull request as ready for review May 14, 2026 10:39
@jan-janssen jan-janssen merged commit d26beef into main May 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants