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