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

Consider Adding Testing Objects #6

Open
ghickman opened this issue Jan 17, 2022 · 0 comments
Open

Consider Adding Testing Objects #6

ghickman opened this issue Jan 17, 2022 · 0 comments

Comments

@ghickman
Copy link
Contributor

ghickman commented Jan 17, 2022

The tests in job-server require some extra set up now that the Pipeline model enforces various pieces of the config. Could we extract some of those ideas into this library as helpers for testing?

Copying how factory_boy builds ORM models some kind of pytest fixture which ensures all the correct values are set for the given input.

Something like:

def pipeline(data: dict[str, Any]) -> Pipeline:
    if "version" not in data:
        data["version"] = "3"

    if "expectations" not in data:
        data["expections"] = {"population_size": 100}

    return Pipeline(**data)
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

No branches or pull requests

1 participant