Integration requirement check refactor (#25626)

* Factor out code getting requirements for integration

* Have process requirements raise an exception

* One more lint fix

* Blackify

* Catch new exception

* Let RequirementsNotFound be a HomeAssistantError

* Correct another test

* Split catching of exceptions and avoid complete log
This commit is contained in:
Joakim Plate 2019-08-08 00:35:50 +02:00 committed by Paulus Schoutsen
parent c3455efc11
commit d1b9ebc7b2
9 changed files with 115 additions and 121 deletions

View file

@ -62,7 +62,9 @@ def test_component_platform_not_found(isfile_patch, loop):
res = check_config.check(get_test_config_dir())
assert res["components"].keys() == {"homeassistant"}
assert res["except"] == {
check_config.ERROR_STR: ["Integration not found: beer"]
check_config.ERROR_STR: [
"Component error: beer - Integration beer not found."
]
}
assert res["secret_cache"] == {}
assert res["secrets"] == {}
@ -75,8 +77,7 @@ def test_component_platform_not_found(isfile_patch, loop):
assert res["components"]["light"] == []
assert res["except"] == {
check_config.ERROR_STR: [
"Integration beer not found when trying to verify its "
"light platform."
"Platform error light.beer - Integration beer not found."
]
}
assert res["secret_cache"] == {}