-
Notifications
You must be signed in to change notification settings - Fork 16
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 tests using custom-components/integration_blueprint#50 as base #112
Conversation
Thank you very much for your contribution. Some general comments you can already process during my code review:
|
🤦🏾♂️ clearly I moved too quickly on this - I have resolved bullet 1. I will add an item for bullet 2 tomorrow, and bullet 3 sometime this weekend. The code has a lot of comments so I will likely just be pulling those together and making them into a single doc |
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.
On top of minor updates or questions, you need to review the tag used from the cookiecutter setting to make it works:
- Friendly name for human readable (ex: My awesome Custom Component)
- Project name with "-" as GitHub request it (ex: my-awesome-custom-component)
- Domain name with "_" as Python package expect it (ex: my_awesome_custom_component)
I've tried my best to suggest modifications but I have perhaps miss some.
Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com>
Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com>
Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com>
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.
Thank you for the modifications. I'm trying to run the test suite with a generated project.
I've identified some improvement to make it works.
To solve an error, we need to add a dummy __init__.py
file in custom_components
folder.
If you want to check the modification ? (you can test the generated project using this branch
Co-authored-by: Oncleben31 <oncleben31@users.noreply.github.com>
Now the project generated by the cookiecutter template succeed to pass the test suite with 100% coverage. Houra ! There are some warnings with config_flow.py tests about some mocking function not awaited. It seem's to be a best practice and make sens in config_flow test suite to avoid calling the @raman325 Can you check the modification I suggest in this commit ? |
good find and good fix. I will submit the same change here |
Only thing to note is that you do not need to pass the fixture in as a parameter to |
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.
Thank you for your contribution
I just pulled the files over and replaced references to
integration_blueprint
with{{cookiecutter.project_name}}
andIntegrationBlueprint
/Blueprint
with{{cookiecutter.class_name_prefix}}
.What might be missing is instructions on how to run the tests, check for coverage, etc but figured someone else could tackle that.
Resolves #10