Clean up some async stuff (#3915)

* Clean up some async stuff

* Adjust comments

* Pass hass instance to eventbus
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2016-10-17 19:38:41 -07:00
1 parent daea93d9f9
commit 4c8d1d9d2f
7 files changed
+139 -111

No files matched your search

+2 -2
View File
@@ -145,14 +145,14 @@ class TestAPI(unittest.TestCase):
requests.post(_url(const.URL_API_STATES_ENTITY.format("test.test")),
data=json.dumps({"state": "not_to_be_set"}),
headers=HA_HEADERS)
hass.bus._pool.block_till_done()
hass.block_till_done()
self.assertEqual(0, len(events))
requests.post(_url(const.URL_API_STATES_ENTITY.format("test.test")),
data=json.dumps({"state": "not_to_be_set",
"force_update": True}),
headers=HA_HEADERS)
hass.bus._pool.block_till_done()
hass.block_till_done()
self.assertEqual(1, len(events))
# pylint: disable=invalid-name