mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Fix import for new AWS aiobotocore lib (#64769)
* Fix import for new AWS aiobotocore lib * Fix patch for tests
This commit is contained in:
@ -36,7 +36,7 @@ class MockAioSession:
|
||||
|
||||
async def test_empty_config(hass):
|
||||
"""Test a default config will be create for empty config."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch("homeassistant.components.aws.AioSession", new=MockAioSession):
|
||||
await async_setup_component(hass, "aws", {"aws": {}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
@ -51,7 +51,7 @@ async def test_empty_config(hass):
|
||||
|
||||
async def test_empty_credential(hass):
|
||||
"""Test a default config will be create for empty credential section."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch("homeassistant.components.aws.AioSession", new=MockAioSession):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
@ -84,7 +84,7 @@ async def test_empty_credential(hass):
|
||||
|
||||
async def test_profile_credential(hass):
|
||||
"""Test credentials with profile name."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch("homeassistant.components.aws.AioSession", new=MockAioSession):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
@ -122,7 +122,7 @@ async def test_profile_credential(hass):
|
||||
|
||||
async def test_access_key_credential(hass):
|
||||
"""Test credentials with access key."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch("homeassistant.components.aws.AioSession", new=MockAioSession):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
@ -167,7 +167,11 @@ async def test_access_key_credential(hass):
|
||||
|
||||
async def test_notify_credential(hass):
|
||||
"""Test notify service can use access key directly."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch(
|
||||
"homeassistant.components.aws.AioSession", new=MockAioSession
|
||||
), async_patch(
|
||||
"homeassistant.components.aws.notify.AioSession", new=MockAioSession
|
||||
):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
@ -201,7 +205,11 @@ async def test_notify_credential(hass):
|
||||
|
||||
async def test_notify_credential_profile(hass):
|
||||
"""Test notify service can use profile directly."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch(
|
||||
"homeassistant.components.aws.AioSession", new=MockAioSession
|
||||
), async_patch(
|
||||
"homeassistant.components.aws.notify.AioSession", new=MockAioSession
|
||||
):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
@ -233,7 +241,7 @@ async def test_notify_credential_profile(hass):
|
||||
|
||||
async def test_credential_skip_validate(hass):
|
||||
"""Test credential can skip validate."""
|
||||
with async_patch("aiobotocore.session.AioSession", new=MockAioSession):
|
||||
with async_patch("homeassistant.components.aws.AioSession", new=MockAioSession):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
"aws",
|
||||
|
Reference in New Issue
Block a user