mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-08 10:29:30 +00:00
Reduce executor code for docker (#4438)
* Reduce executor code for docker * Fix pylint errors and move import/export image * Fix test and a couple other risky executor calls * Fix dataclass and return * Fix test case and add one for corrupt docker * Add some coverage * Undo changes to docker manager startup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Test Docker interface."""
|
||||
import asyncio
|
||||
from typing import Any
|
||||
from unittest.mock import MagicMock, Mock, PropertyMock, call, patch
|
||||
|
||||
@@ -151,6 +152,7 @@ async def test_attach_existing_container(
|
||||
"supervisor.docker.interface.time", return_value=1
|
||||
):
|
||||
await coresys.homeassistant.core.instance.attach(AwesomeVersion("2022.7.3"))
|
||||
await asyncio.sleep(0)
|
||||
fire_event.assert_called_once_with(
|
||||
BusEvent.DOCKER_CONTAINER_STATE_CHANGE,
|
||||
DockerContainerStateEvent("homeassistant", expected, "abc123", 1),
|
||||
@@ -160,6 +162,7 @@ async def test_attach_existing_container(
|
||||
await coresys.homeassistant.core.instance.attach(
|
||||
AwesomeVersion("2022.7.3"), skip_state_event_if_down=True
|
||||
)
|
||||
await asyncio.sleep(0)
|
||||
if fired_when_skip_down:
|
||||
fire_event.assert_called_once_with(
|
||||
BusEvent.DOCKER_CONTAINER_STATE_CHANGE,
|
||||
|
||||
Reference in New Issue
Block a user