Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@pytest.fixture(name="vws_client")
def fixture_vws_client(vuforia_database: CloudDatabase) -> VWS:
def fixture_vws_client(*, vuforia_database: CloudDatabase) -> VWS:
"""A VWS client for an active VWS database."""
return VWS(
server_access_key=vuforia_database.server_access_key,
Expand All @@ -31,7 +31,7 @@ def fixture_vws_client(vuforia_database: CloudDatabase) -> VWS:


@pytest.fixture
def cloud_reco_client(vuforia_database: CloudDatabase) -> CloudRecoService:
def cloud_reco_client(*, vuforia_database: CloudDatabase) -> CloudRecoService:
"""A query client for an active VWS database."""
return CloudRecoService(
client_access_key=vuforia_database.client_access_key,
Expand All @@ -40,7 +40,10 @@ def cloud_reco_client(vuforia_database: CloudDatabase) -> CloudRecoService:


@pytest.fixture(name="inactive_vws_client")
def fixture_inactive_vws_client(inactive_cloud_database: CloudDatabase) -> VWS:
def fixture_inactive_vws_client(
*,
inactive_cloud_database: CloudDatabase,
) -> VWS:
"""A client for an inactive VWS database."""
return VWS(
server_access_key=inactive_cloud_database.server_access_key,
Expand All @@ -50,6 +53,7 @@ def fixture_inactive_vws_client(inactive_cloud_database: CloudDatabase) -> VWS:

@pytest.fixture
def inactive_cloud_reco_client(
*,
inactive_cloud_database: CloudDatabase,
) -> CloudRecoService:
"""A query client for an inactive VWS database."""
Expand All @@ -61,6 +65,7 @@ def inactive_cloud_reco_client(

@pytest.fixture
def target_id(
*,
image_file_success_state_low_rating: io.BytesIO,
vws_client: VWS,
) -> str:
Expand Down Expand Up @@ -91,7 +96,7 @@ def target_id(
"vumark_generate_instance",
],
)
def endpoint(request: pytest.FixtureRequest) -> Endpoint:
def endpoint(*, request: pytest.FixtureRequest) -> Endpoint:
"""
Return details of an endpoint for the Target API or the Query
API.
Expand Down Expand Up @@ -120,7 +125,7 @@ def endpoint(request: pytest.FixtureRequest) -> Endpoint:
),
],
)
def not_base64_encoded_processable(request: pytest.FixtureRequest) -> str:
def not_base64_encoded_processable(*, request: pytest.FixtureRequest) -> str:
"""Return a string which is not decodable as base64 data, but Vuforia
will
respond as if this is valid base64 data.
Expand All @@ -144,7 +149,10 @@ def not_base64_encoded_processable(request: pytest.FixtureRequest) -> str:
pytest.param('"', id="Not a base64 character."),
],
)
def not_base64_encoded_not_processable(request: pytest.FixtureRequest) -> str:
def not_base64_encoded_not_processable(
*,
request: pytest.FixtureRequest,
) -> str:
"""
Return a string which is not decodable as base64 data, and Vuforia
will
Expand Down
12 changes: 10 additions & 2 deletions tests/mock_vws/fixtures/prepared_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def _wait_for_target_processed(*, vws_client: VWS, target_id: str) -> None:

@pytest.fixture
def add_target(
*,
vuforia_database: CloudDatabase,
image_file_failed_state: io.BytesIO,
) -> Endpoint:
Expand Down Expand Up @@ -93,6 +94,7 @@ def add_target(

@pytest.fixture
def delete_target(
*,
vuforia_database: CloudDatabase,
target_id: str,
vws_client: VWS,
Expand Down Expand Up @@ -136,7 +138,7 @@ def delete_target(


@pytest.fixture
def database_summary(vuforia_database: CloudDatabase) -> Endpoint:
def database_summary(*, vuforia_database: CloudDatabase) -> Endpoint:
"""
Return details of the endpoint for getting details about the
database.
Expand Down Expand Up @@ -180,6 +182,7 @@ def database_summary(vuforia_database: CloudDatabase) -> Endpoint:

@pytest.fixture
def get_duplicates(
*,
vuforia_database: CloudDatabase,
target_id: str,
vws_client: VWS,
Expand Down Expand Up @@ -228,6 +231,7 @@ def get_duplicates(

@pytest.fixture
def get_target(
*,
vuforia_database: CloudDatabase,
target_id: str,
vws_client: VWS,
Expand Down Expand Up @@ -272,7 +276,7 @@ def get_target(


@pytest.fixture
def target_list(vuforia_database: CloudDatabase) -> Endpoint:
def target_list(*, vuforia_database: CloudDatabase) -> Endpoint:
"""Return details of the endpoint for getting a list of targets."""
date = rfc_1123_date()
request_path = "/targets"
Expand Down Expand Up @@ -313,6 +317,7 @@ def target_list(vuforia_database: CloudDatabase) -> Endpoint:

@pytest.fixture
def target_summary(
*,
vuforia_database: CloudDatabase,
target_id: str,
vws_client: VWS,
Expand Down Expand Up @@ -361,6 +366,7 @@ def target_summary(

@pytest.fixture
def update_target(
*,
vuforia_database: CloudDatabase,
target_id: str,
vws_client: VWS,
Expand Down Expand Up @@ -409,6 +415,7 @@ def update_target(

@pytest.fixture
def query(
*,
vuforia_database: CloudDatabase,
high_quality_image: io.BytesIO,
) -> Endpoint:
Expand Down Expand Up @@ -459,6 +466,7 @@ def query(

@pytest.fixture
def vumark_generate_instance(
*,
vumark_vuforia_database: VuMarkCloudDatabase,
) -> Endpoint:
"""Return details of the endpoint for generating a VuMark instance."""
Expand Down
2 changes: 1 addition & 1 deletion tests/mock_vws/test_flask_app_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture(autouse=True)
def _(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
def _(*, monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
"""Enable a mock service backed by the Flask applications."""
with responses.RequestsMock(
assert_all_requests_are_fired=False,
Expand Down