vws-test-fixtures¶
pytest
fixtures for testing tools with the Vuforia Web Services (VWS) API.
Installation¶
pip install vws-test-fixtures
This is tested on Python 3.13+.
Example usage¶
"""Run a test which uses a high quality image."""
import io
def test_high_quality_image(high_quality_image: io.BytesIO) -> None:
"""Test that a high quality image is given."""
image_file_bytes = high_quality_image.getvalue()
minimum_image_size = 1000
assert len(image_file_bytes) >= minimum_image_size
All fixtures¶
Use the names of the following methods as fixture names.
Fixtures for images.
- fixture vws_test_fixtures.images.high_quality_image¶
Scope: function
An image file which is expected to have a ‘success’ status when added to a target and a high tracking rating.
At the time of writing, this image gains a tracking rating of 5.
- fixture vws_test_fixtures.images.image_file_failed_state¶
Scope: function
An image file which is expected to be accepted by the add and update target endpoints, but get a “failed” status.
- fixture vws_test_fixtures.images.png_too_large¶
Scope: function
Return a PNG file which has dimensions which are too large to be added to a Vuforia database.
- fixture vws_test_fixtures.images.image_file_success_state_low_rating¶
Scope: function
An image file which is expected to have a ‘success’ status when added to a target and a low rating after processing.
- fixture vws_test_fixtures.images.corrupted_image_file¶
Scope: function
An image file which is corrupted.
- fixture vws_test_fixtures.images.image_files_failed_state¶
Scope: function
An image file which is expected to be accepted by the add and update target endpoints, but get a “failed” status.
- fixture vws_test_fixtures.images.bad_image_file¶
Scope: function
An image file which is expected to cause a BadImage result when an attempt is made to add it to the target database.
- fixture vws_test_fixtures.images.different_high_quality_image¶
Scope: function
An image file which is expected to have a ‘success’ status when added to a target and a high tracking rating.
This is necessarily different to
high_quality_image
.