vws-python-mock¶
Mocking calls made to Vuforia¶
$ pip install vws-python-mock
This requires Python 3.13+.
MockVWS intercepts requests to Vuforia made with requests or httpx.
"""Make a request to the Vuforia Web Services API mock."""
import requests
from mock_vws import MockVWS
from mock_vws.database import CloudDatabase
with MockVWS() as mock:
database = CloudDatabase()
mock.add_cloud_database(cloud_database=database)
# This will use the Vuforia mock.
requests.get(url="https://vws.vuforia.com/summary", timeout=30)
By default, an exception will be raised if any requests to unmocked addresses are made.
See API Reference for details of what can be changed and how.
MockVWS also intercepts requests made with httpx.
"""Make a request to the Vuforia Web Services API mock using httpx."""
import httpx
from mock_vws import MockVWS
from mock_vws.database import CloudDatabase
with MockVWS() as mock:
database = CloudDatabase()
mock.add_cloud_database(cloud_database=database)
# This will use the Vuforia mock.
httpx.get(url="https://vws.vuforia.com/summary", timeout=30)
Using Docker to mock calls to Vuforia from any language¶
It is possible run a Mock VWS instance using Docker containers.
This allows you to run tests against a mock VWS instance regardless of the language or tooling you are using.
See Running a server with Docker for how to do this.
Reference¶
- Installation
- Getting started
- Running a server with Docker
- API Reference
MockVWSMissingSchemeErrorCloudDatabaseCloudDatabase.database_nameCloudDatabase.server_access_keyCloudDatabase.server_secret_keyCloudDatabase.client_access_keyCloudDatabase.client_secret_keyCloudDatabase.targetsCloudDatabase.stateCloudDatabase.database_typeCloudDatabase.request_quotaCloudDatabase.reco_thresholdCloudDatabase.current_month_recosCloudDatabase.previous_month_recosCloudDatabase.total_recosCloudDatabase.target_quota
VuMarkDatabaseStatesDatabaseTypeImageTargetVuMarkTarget- Image matchers
- Target raters
- Differences between the mock and the real Vuforia Web Services
- Image matching
- Speed and summary accuracy
- Image quality and ratings
- Matching recently deleted targets
- Accepted date formats for the Query API
- Targets stuck in processing
- Database summary quotas
transfer-encodingheadersContent-Encodingheaders- NGINX Error cases
- Result codes
Content-Lengthheaders- VuMark instance images
- Header cases
- Versioning, Support and API Stability
- Contributing to vws-python-mock