8000 Setup all valid platforms, ignore invalid platforms by kellerza · Pull Request #3736 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Setup all valid platforms, ignore invalid platforms #3736

8000
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

Merged
merged 1 commit into from
Oct 8, 2016

Conversation

kellerza
Copy link
Member
@kellerza kellerza commented Oct 6, 2016

Description:
Setup all valid platforms, while ignoring invalid ones - #3550 - story

setup_component will now almost always return true. In order to check valid/invalid setups a new context manager was added to tests/common

def assert_setup_component(count, domain=None):

Parameters:

  • count: The amount of valid platforms that should be setup
  • domain: The domain to count is optional. It can be automatically
    determined most of the time

Example usage (Use as a context manager aroung bootstrap.setup_component)

        with assert_setup_component(0) as result_config:
            setup_component(hass, start_config, domain)
            # using result_config is optional

Related issue (if applicable): fixes #

Example entry for configuration.yaml (if applicable):

sensor:
- platform: forecast
  api_key: !secret forecast_key
  monitored_conditions:
    - summary
    - icon
- platform: darksky
  api_key: !secret forecast_key
  monitored_conditions:
    - summary
    - icon

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@mention-bot
Copy link

@kellerza, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pavoni, @balloob and @joelash to be potential reviewers.

@kellerza
Copy link
Member Author
kellerza commented Oct 6, 2016

Eventually all setup_component() calls in tests should be wrapped in the assert_setup_component context manager. For now I have done all assert not and some others

@balloob
Copy link
Member
balloob commented Oct 8, 2016

Great! 🐬

@balloob
Copy link
Member
balloob commented Oct 8, 2016 8000

I'm going to keep this one for 0.31. Don't want to merge new features for 0.30 anymore.

@balloob balloob added this to the 0.31 milestone Oct 8, 2016
@kellerza
Copy link
Member Author
kellerza commented Oct 8, 2016

Great, will merge it soon after 0.30 goes out. I'm already dreading all the files requiring rebase... 😨

@balloob balloob merged commit 7b40a64 into home-assistant:dev Oct 8, 2016
@balloob
Copy link
Member
balloob commented Oct 8, 2016

No rebasing needed 👍 💃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0