mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-05-19 14:18:53 +01:00
0de6d25fed
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.
22 lines
511 B
Python
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)
|