Coverage for src/tests/api/v1/conftest.py: 100%
22 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module for defining reusable fixtures."""
3from typing import Any
5import pytest
7from kwai_bc_club.domain.country import CountryEntity, CountryIdentifier
9from tests.fixtures.club.coaches import * # noqa
10from tests.fixtures.club.contacts import * # noqa
11from tests.fixtures.club.countries import * # noqa
12from tests.fixtures.club.members import * # noqa
13from tests.fixtures.club.persons import * # noqa
14from tests.fixtures.identity.users import * # noqa
15from tests.fixtures.portal.applications import * # noqa
16from tests.fixtures.portal.authors import * # noqa
17from tests.fixtures.portal.news import * # noqa
18from tests.fixtures.portal.pages import * # noqa
19from tests.fixtures.teams.teams import * # noqa
20from tests.fixtures.training.training_schemas import * # noqa
21from tests.fixtures.training.trainings import * # noqa
24@pytest.fixture
25def country() -> CountryEntity:
26 """A fixture for a country."""
27 return CountryEntity(id=CountryIdentifier(1), iso_2="JP", iso_3="JPN", name="Japan")
30@pytest.fixture
31def expected_country_json() -> dict[str, Any]:
32 """A fixture for a JSON:API resource of a country."""
33 return {
34 "data": {
35 "id": "1",
36 "type": "countries",
37 "attributes": {"iso_2": "JP", "iso_3": "JPN", "name": "Japan"},
38 }
39 }