1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-19 14:18:53 +01:00
Files
supervisor/tests/docker/conftest.py
T
Stefan Agner 0de6d25fed Drop legacy test classes in favor of module-level functions (#6796)
Per CLAUDE.md, plain test_* functions are the project style; class-
based test grouping is considered legacy. Convert the 24 test methods
in test_pull_progress.py (TestLayerProgress, TestImagePullProgress)
to module-level functions — none of them used self, so the rewrite is
mechanical.

Also rename three helper classes whose names accidentally matched
pytest's Test* collection pattern, even though they are fakes/fixtures
rather than test cases:
- TestAddon  -> FakeApp (data holder used as a fake App in pwned tests)
- TestDockerInterface -> FakeDockerInterface (fixture/inner helper in
  docker tests)

The two DBusServiceMock subclasses named TestInterface already had
__test__ = False and are left alone.
2026-05-04 21:38:22 +02:00

22 lines
511 B
Python

"""Fixtures for docker tests."""
import pytest
from supervisor.coresys import CoreSys
from supervisor.docker.interface import DockerInterface
class FakeDockerInterface(DockerInterface):
"""Fake docker interface for tests."""
@property
def name(self) -> str:
"""Name of test interface."""
return "test_interface"
@pytest.fixture
def test_docker_interface(coresys: CoreSys) -> FakeDockerInterface:
"""Return test docker interface."""
return FakeDockerInterface(coresys)