-
Notifications
You must be signed in to change notification settings - Fork 171
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
Add example tests #50
Conversation
Nice, I was planning to work on this topic to integrate tests in my cookiecutter project for custom component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add executing the tests to:
- https://github.com/custom-components/integration_blueprint/blob/master/.github/workflows/push.yml
- https://github.com/custom-components/integration_blueprint/blob/master/.github/workflows/pull.yml
And it's good to go 👍
Don't forget to pin the requirements as done in oncleben31/cookiecutter-homeassistant-custom-component#112 to avoid potential difficulties for new install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🎉
* add tests using ludeeus/integration_blueprint#50 as base * move tests folder to the right place * add test files to files table * try to fix * move requirements to appropriate folder * add a note to contributing about tests * add a note to contributing about tests * Update docs/guide.rst Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * Update {{cookiecutter.project_name}}/CONTRIBUTING.md Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * Update {{cookiecutter.project_name}}/tests/test_init.py Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * address review comments * add more comments * fix description for requirements files * add more comments * update gitignore and fix CONTRIBUTING * add dummy init file so that pytest works * Update {{cookiecutter.project_name}}/requirements_test.txt Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * fix import statements * Fix spelling * bypass setup in config flow * fix comment * incorporate comments that were in integration_blueprint PR * add tests to isort known_first_party Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com>
* add tests using ludeeus/integration_blueprint#50 as base * move tests folder to the right place * add test files to files table * try to fix * move requirements to appropriate folder * add a note to contributing about tests * add a note to contributing about tests * Update docs/guide.rst Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * Update {{cookiecutter.project_name}}/CONTRIBUTING.md Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * Update {{cookiecutter.project_name}}/tests/test_init.py Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * address review comments * add more comments * fix description for requirements files * add more comments * update gitignore and fix CONTRIBUTING * add dummy init file so that pytest works * Update {{cookiecutter.project_name}}/requirements_test.txt Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> * fix import statements * Fix spelling * bypass setup in config flow * fix comment * incorporate comments that were in integration_blueprint PR * add tests to isort known_first_party Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com> Original-Commit: oncleben31/cookiecutter-homeassistant-custom-component@b5c30b5
Core integrations can look at other integrations to learn how to write tests but there is no equivalent for custom components. This PR adds 100% test coverage to
integration_blueprint
along with some additional information which will help authors write tests for their custom components.