Merge multiple context managers in tests (#48146)
This commit is contained in:
parent
79af18a8ab
commit
ad13a9295e
33 changed files with 590 additions and 627 deletions
|
@ -28,13 +28,14 @@ async def test_apprise_config_load_fail02(hass):
|
|||
BASE_COMPONENT: {"name": "test", "platform": "apprise", "config": "/path/"}
|
||||
}
|
||||
|
||||
with patch("apprise.Apprise.add", return_value=False):
|
||||
with patch("apprise.AppriseConfig.add", return_value=True):
|
||||
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
||||
await hass.async_block_till_done()
|
||||
with patch("apprise.Apprise.add", return_value=False), patch(
|
||||
"apprise.AppriseConfig.add", return_value=True
|
||||
):
|
||||
assert await async_setup_component(hass, BASE_COMPONENT, config)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
# Test that our service failed to load
|
||||
assert not hass.services.has_service(BASE_COMPONENT, "test")
|
||||
# Test that our service failed to load
|
||||
assert not hass.services.has_service(BASE_COMPONENT, "test")
|
||||
|
||||
|
||||
async def test_apprise_config_load_okay(hass, tmp_path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue