1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-17 23:33:35 +01:00

Migrate export image to aiodocker (#6534)

* Migrate export image to aiodocker

* Remove aiofiles and just use executor

* Fixes from feedback
This commit is contained in:
Mike Degatano
2026-02-11 04:03:50 -05:00
committed by GitHub
parent 7e91cfe01c
commit 825ff415e0
6 changed files with 108 additions and 72 deletions

View File

@@ -196,6 +196,21 @@ async def docker() -> DockerAPI:
)
docker_images.pull.return_value = AsyncIterator([{}])
# Export image mocking
class MockCM:
def __init__(self):
self.content = [b""]
async def __aenter__(self):
out = MagicMock()
out.iter_chunked.return_value = AsyncIterator(self.content)
return out
async def __aexit__(self, exc_type, exc, tb):
return None
docker_images.export_image.return_value = MockCM()
# Containers mocking
docker_containers.get.return_value = docker_container = MagicMock(
spec=DockerContainer, id=container_inspect["Id"]