Drop unnecessary block_till_done for MQTT tests (#23254)
* Drop unnecessary block_till_done * Drop unnecessary block_till_done
This commit is contained in:
1 parent
28c411c742
commit
2c42e1a5cb
2 files changed
-22
No files matched your search
@@ -33,15 +33,12 @@ async def test_subscribe_topics(hass, mqtt_mock, caplog):
|
||||
'msg_callback': record_calls2}})
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic1', 'test-payload1')
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 'test-topic1' == calls1[0][0].topic
|
||||
assert 'test-payload1' == calls1[0][0].payload
|
||||
assert 0 == len(calls2)
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic2', 'test-payload2')
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 1 == len(calls2)
|
||||
assert 'test-topic2' == calls2[0][0].topic
|
||||
@@ -52,7 +49,6 @@ async def test_subscribe_topics(hass, mqtt_mock, caplog):
|
||||
async_fire_mqtt_message(hass, 'test-topic1', 'test-payload')
|
||||
async_fire_mqtt_message(hass, 'test-topic2', 'test-payload')
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 1 == len(calls2)
|
||||
|
||||
@@ -82,13 +78,10 @@ async def test_modify_topics(hass, mqtt_mock, caplog):
|
||||
'msg_callback': record_calls2}})
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic1', 'test-payload')
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 0 == len(calls2)
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic2', 'test-payload')
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 1 == len(calls2)
|
||||
|
||||
@@ -99,14 +92,10 @@ async def test_modify_topics(hass, mqtt_mock, caplog):
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic1', 'test-payload')
|
||||
async_fire_mqtt_message(hass, 'test-topic2', 'test-payload')
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
assert 1 == len(calls1)
|
||||
assert 1 == len(calls2)
|
||||
|
||||
async_fire_mqtt_message(hass, 'test-topic1_1', 'test-payload')
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
assert 2 == len(calls1)
|
||||
assert 'test-topic1_1' == calls1[1][0].topic
|
||||
assert 'test-payload' == calls1[1][0].payload
|
||||
@@ -117,7 +106,6 @@ async def test_modify_topics(hass, mqtt_mock, caplog):
|
||||
async_fire_mqtt_message(hass, 'test-topic1_1', 'test-payload')
|
||||
async_fire_mqtt_message(hass, 'test-topic2', 'test-payload')
|
||||
|
||||
await hass.async_block_till_done()
|
||||
assert 2 == len(calls1)
|
||||
assert 1 == len(calls2)
|
||||
|
||||
|
||||
Reference in new issue
Block a user