Reduce scope of JSON/XML test fixtures (#126590)
parent
4869309997
commit
3c9f51fbbd
|
@ -32,13 +32,13 @@ class MockDoorbirdEntry:
|
|||
api: MagicMock
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def doorbird_info() -> dict[str, Any]:
|
||||
"""Return a loaded DoorBird info fixture."""
|
||||
return load_json_value_fixture("info.json", "doorbird")["BHA"]["VERSION"][0]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def doorbird_schedule() -> list[DoorBirdScheduleEntry]:
|
||||
"""Return a loaded DoorBird schedule fixture."""
|
||||
return DoorBirdScheduleEntry.parse_all(
|
||||
|
@ -46,7 +46,7 @@ def doorbird_schedule() -> list[DoorBirdScheduleEntry]:
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def doorbird_schedule_wrong_param() -> list[DoorBirdScheduleEntry]:
|
||||
"""Return a loaded DoorBird schedule fixture with an incorrect param."""
|
||||
return DoorBirdScheduleEntry.parse_all(
|
||||
|
@ -54,7 +54,7 @@ def doorbird_schedule_wrong_param() -> list[DoorBirdScheduleEntry]:
|
|||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def doorbird_favorites() -> dict[str, dict[str, Any]]:
|
||||
"""Return a loaded DoorBird favorites fixture."""
|
||||
return load_json_value_fixture("favorites.json", "doorbird")
|
||||
|
|
|
@ -40,13 +40,13 @@ def mock_geniushub_client() -> Generator[AsyncMock]:
|
|||
yield client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def zones() -> list[dict[str, Any]]:
|
||||
"""Return a list of zones."""
|
||||
return load_json_array_fixture("zones_cloud_test_data.json", DOMAIN)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def devices() -> list[dict[str, Any]]:
|
||||
"""Return a list of devices."""
|
||||
return load_json_array_fixture("devices_cloud_test_data.json", DOMAIN)
|
||||
|
|
|
@ -46,37 +46,37 @@ def mock_ondilo_client(
|
|||
yield client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def pool1() -> list[dict[str, Any]]:
|
||||
"""First pool description."""
|
||||
return [load_json_object_fixture("pool1.json", DOMAIN)]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def pool2() -> list[dict[str, Any]]:
|
||||
"""Second pool description."""
|
||||
return [load_json_object_fixture("pool2.json", DOMAIN)]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def ico_details1() -> dict[str, Any]:
|
||||
"""ICO details of first pool."""
|
||||
return load_json_object_fixture("ico_details1.json", DOMAIN)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def ico_details2() -> dict[str, Any]:
|
||||
"""ICO details of second pool."""
|
||||
return load_json_object_fixture("ico_details2.json", DOMAIN)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def last_measures() -> list[dict[str, Any]]:
|
||||
"""Pool measurements."""
|
||||
return load_json_array_fixture("last_measures.json", DOMAIN)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@pytest.fixture(scope="package")
|
||||
def two_pools(
|
||||
pool1: list[dict[str, Any]], pool2: list[dict[str, Any]]
|
||||
) -> list[dict[str, Any]]:
|
||||
|
|
Loading…
Reference in New Issue