Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate with jsonschema #1417

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion planemo/galaxy/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def _job_outputs_template_from_invocation(invocation_id, galaxy_url, galaxy_api_
download_function=user_gi.datasets.download_dataset,
definition_style="outputs",
)
outputs[label] = {"element_tests": element_tests}
outputs[label] = {"elements": element_tests}
return outputs


Expand Down
11 changes: 11 additions & 0 deletions planemo/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ def structured_test_data(self, run_response):
"""


def elements_to_element_tests(output_expectations):
# I'm seeing this as a temporary fix, ultimately
# we should use pydantic to parse the tests and use
# pydantic models (or dataclasses) throughout the
# test framework.
for output_value in output_expectations.values():
if isinstance(output_value, dict) and "elements" in output_value:
output_value["element_tests"] = output_value.pop("elements")


class TestCase(AbstractTestCase):
"""Describe an abstract test case for a specified runnable."""

Expand All @@ -359,6 +369,7 @@ def __init__(
self.runnable = runnable
self.job_path = job_path
self.job = job
elements_to_element_tests(output_expectations)
self.output_expectations = output_expectations
self.tests_directory = tests_directory
self.index = index
Expand Down
Empty file added planemo/schema/__init__.py
Empty file.
Loading
Loading