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

Unit tests for RecipeTypes.py #288

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jurgenwigg
Copy link
Contributor

I've created unit tests for the RecipeTypes module. This is a first step before making any refactors.

@waddlesplash
Copy link
Member

These tests don't seem very interesting, they just duplicate a bunch of constants and assert that they are the same.

@jurgenwigg
Copy link
Contributor Author

Agree, but I prefer to write even that simple tests before making refactor in the file.

@waddlesplash
Copy link
Member

But if all the test file does is copy data from the file, then it's not really worth anything, but just makes one more thing you have to update whenever modifying the file.

@jurgenwigg
Copy link
Contributor Author

In case when there are no unit tests at all and some code depends on the data and API of RecipeTypes I prefer to have UT for testing the API. Generally you are right, but I would like to refactor RecipeTypes as it is stated in the comments in the code and have some form of source of truth.

@waddlesplash
Copy link
Member

RecipeTypes is already the "source of truth" for these values, though. The only other possible source would be the Haiku source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants