Do async_setup_platform in background (#36244)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus SchoutsenandJ. Nick Koston authored and GitHub committed 2020-05-31 22:18:30 -07:00
1 parent d488c779fc
commit 276f3afb00
161 files changed
+1184 -305

No files matched your search

+2
View File
@@ -85,6 +85,7 @@ class TestEfergySensor(unittest.TestCase):
"""Test for successfully setting up the Efergy platform."""
mock_responses(mock)
assert setup_component(self.hass, "sensor", {"sensor": ONE_SENSOR_CONFIG})
self.hass.block_till_done()
assert "38.21" == self.hass.states.get("sensor.energy_consumed").state
assert "1580" == self.hass.states.get("sensor.energy_usage").state
@@ -97,6 +98,7 @@ class TestEfergySensor(unittest.TestCase):
"""Test for multiple sensors in one household."""
mock_responses(mock)
assert setup_component(self.hass, "sensor", {"sensor": MULTI_SENSOR_CONFIG})
self.hass.block_till_done()
assert "218" == self.hass.states.get("sensor.efergy_728386").state
assert "1808" == self.hass.states.get("sensor.efergy_0").state