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
1 change: 1 addition & 0 deletions ci/test_custom_linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_ci_patterns_valid(request: pytest.FixtureRequest) -> None:


def test_tests_collected_once(
*,
capsys: pytest.CaptureFixture[str],
request: pytest.FixtureRequest,
) -> None:
Expand Down
26 changes: 26 additions & 0 deletions tests/mock_vws/test_add_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class TestContentTypes:
],
)
def test_content_types(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
content_type: str,
Expand All @@ -129,6 +130,7 @@ def test_content_types(

@staticmethod
def test_empty_content_type(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -174,6 +176,7 @@ class TestMissingData:
argvalues=["name", "width", "image"],
)
def test_missing_data(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
data_to_remove: str,
Expand Down Expand Up @@ -212,6 +215,7 @@ class TestWidth:
ids=["Negative", "Wrong Type", "None", "Zero"],
)
def test_width_invalid(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
width: int | str | None,
Expand Down Expand Up @@ -239,6 +243,7 @@ def test_width_invalid(

@staticmethod
def test_width_valid(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -273,6 +278,7 @@ class TestTargetName:
ids=["Short name", "Max char value", "Long name"],
)
def test_name_valid(
*,
name: str,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
Expand Down Expand Up @@ -310,6 +316,7 @@ def test_name_valid(
],
)
def test_name_invalid(
*,
name: str | int | None,
image_file_failed_state: io.BytesIO,
status_code: int,
Expand Down Expand Up @@ -349,6 +356,7 @@ def test_name_invalid(

@staticmethod
def test_existing_target_name(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -378,6 +386,7 @@ def test_existing_target_name(

@staticmethod
def test_deleted_existing_target_name(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -411,6 +420,7 @@ class TestImage:

@staticmethod
def test_image_valid(
*,
vws_client: VWS,
image_files_failed_state: io.BytesIO,
) -> None:
Expand All @@ -428,6 +438,7 @@ def test_image_valid(

@staticmethod
def test_bad_image_format_or_color_space(
*,
bad_image_file: io.BytesIO,
vws_client: VWS,
) -> None:
Expand All @@ -454,6 +465,7 @@ def test_bad_image_format_or_color_space(

@staticmethod
def test_corrupted(
*,
corrupted_image_file: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -543,6 +555,7 @@ def test_image_file_size_too_large(vws_client: VWS) -> None:

@staticmethod
def test_not_base64_encoded_processable(
*,
vws_client: VWS,
not_base64_encoded_processable: str,
) -> None:
Expand Down Expand Up @@ -570,6 +583,7 @@ def test_not_base64_encoded_processable(

@staticmethod
def test_not_base64_encoded_not_processable(
*,
vws_client: VWS,
not_base64_encoded_not_processable: str,
) -> None:
Expand Down Expand Up @@ -622,6 +636,7 @@ def test_not_image(vws_client: VWS) -> None:
argvalues=[1, None],
)
def test_invalid_type(
*,
invalid_type_image: int | None,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -681,6 +696,7 @@ def test_valid(

@staticmethod
def test_invalid(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -717,6 +733,7 @@ def test_invalid(

@staticmethod
def test_not_set(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand All @@ -740,6 +757,7 @@ def test_not_set(

@staticmethod
def test_set_to_none(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -773,6 +791,7 @@ class TestUnexpectedData:

@staticmethod
def test_invalid_extra_data(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -816,6 +835,7 @@ class TestApplicationMetadata:
ids=["Short", "Max length"],
)
def test_base64_encoded(
*,
image_file_failed_state: io.BytesIO,
metadata: bytes,
vws_client: VWS,
Expand All @@ -835,6 +855,7 @@ def test_base64_encoded(

@staticmethod
def test_null(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand All @@ -860,6 +881,7 @@ def test_null(

@staticmethod
def test_invalid_type(
*,
vws_client: VWS,
image_file_failed_state: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -890,6 +912,7 @@ def test_invalid_type(

@staticmethod
def test_not_base64_encoded_processable(
*,
high_quality_image: io.BytesIO,
not_base64_encoded_processable: str,
vws_client: VWS,
Expand All @@ -909,6 +932,7 @@ def test_not_base64_encoded_processable(

@staticmethod
def test_not_base64_encoded_not_processable(
*,
high_quality_image: io.BytesIO,
not_base64_encoded_not_processable: str,
vws_client: VWS,
Expand All @@ -935,6 +959,7 @@ def test_not_base64_encoded_not_processable(

@staticmethod
def test_metadata_too_large(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -970,6 +995,7 @@ class TestInactiveProject:

@staticmethod
def test_inactive_project(
*,
image_file_failed_state: io.BytesIO,
inactive_vws_client: VWS,
) -> None:
Expand Down
2 changes: 2 additions & 0 deletions tests/mock_vws/test_authorization_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def test_bad_access_key_services(

@staticmethod
def test_bad_access_key_query(
*,
vuforia_database: CloudDatabase,
high_quality_image: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -328,6 +329,7 @@ def test_bad_secret_key_services(

@staticmethod
def test_bad_secret_key_query(
*,
vuforia_database: CloudDatabase,
high_quality_image: io.BytesIO,
) -> None:
Expand Down
10 changes: 9 additions & 1 deletion tests/mock_vws/test_database_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class TestDatabaseSummary:

@staticmethod
def test_success(
*,
vuforia_database: CloudDatabase,
vws_client: VWS,
) -> None:
Expand All @@ -110,7 +111,7 @@ def test_success(
)

@staticmethod
def test_active_images(vws_client: VWS, target_id: str) -> None:
def test_active_images(*, vws_client: VWS, target_id: str) -> None:
"""The number of images in the active state is returned."""
vws_client.wait_for_target_processed(target_id=target_id)

Expand All @@ -124,6 +125,7 @@ def test_active_images(vws_client: VWS, target_id: str) -> None:

@staticmethod
def test_failed_images(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand All @@ -148,6 +150,7 @@ def test_failed_images(

@staticmethod
def test_inactive_images(
*,
vws_client: VWS,
image_file_success_state_low_rating: io.BytesIO,
) -> None:
Expand Down Expand Up @@ -176,6 +179,7 @@ def test_inactive_images(

@staticmethod
def test_inactive_failed(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand All @@ -200,6 +204,7 @@ def test_inactive_failed(

@staticmethod
def test_deleted(
*,
image_file_failed_state: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -289,6 +294,7 @@ class TestRecos:

@staticmethod
def test_query_request(
*,
cloud_reco_client: CloudRecoService,
high_quality_image: io.BytesIO,
vws_client: VWS,
Expand Down Expand Up @@ -344,6 +350,7 @@ def test_target_request(vws_client: VWS) -> None:

@staticmethod
def test_bad_target_request(
*,
high_quality_image: io.BytesIO,
vws_client: VWS,
) -> None:
Expand Down Expand Up @@ -372,6 +379,7 @@ def test_bad_target_request(

@staticmethod
def test_query_request(
*,
cloud_reco_client: CloudRecoService,
high_quality_image: io.BytesIO,
vws_client: VWS,
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_vws/test_delete_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestDelete:
"""Tests for deleting targets."""

@staticmethod
def test_no_wait(target_id: str, vws_client: VWS) -> None:
def test_no_wait(*, target_id: str, vws_client: VWS) -> None:
"""When attempting to delete a target immediately after creating
it, a
`FORBIDDEN` response is returned.
Expand All @@ -41,7 +41,7 @@ def test_no_wait(target_id: str, vws_client: VWS) -> None:
)

@staticmethod
def test_processed(target_id: str, vws_client: VWS) -> None:
def test_processed(*, target_id: str, vws_client: VWS) -> None:
"""When a target has finished processing, it can be deleted."""
vws_client.wait_for_target_processed(target_id=target_id)
vws_client.delete_target(target_id=target_id)
Expand Down
1 change: 1 addition & 0 deletions tests/mock_vws/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def fixture_custom_bridge_network() -> Iterator[Network]:

@pytest.mark.requires_docker_build
def test_build_and_run(
*,
high_quality_image: io.BytesIO,
custom_bridge_network: Network,
request: pytest.FixtureRequest,
Expand Down
Loading