vws-python-mock¶
Mocking calls made to Vuforia with Python requests
¶
$ pip install vws-python-mock
This requires Python 3.13+.
Using the mock redirects requests to Vuforia made with requests to an in-memory implementation.
"""Make a request to the Vuforia Web Services API mock."""
import requests
from mock_vws import MockVWS
from mock_vws.database import VuforiaDatabase
with MockVWS() as mock:
database = VuforiaDatabase()
mock.add_database(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.
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
MockVWS
MissingSchemeError
VuforiaDatabase
VuforiaDatabase.database_name
VuforiaDatabase.server_access_key
VuforiaDatabase.server_secret_key
VuforiaDatabase.client_access_key
VuforiaDatabase.client_secret_key
VuforiaDatabase.targets
VuforiaDatabase.state
VuforiaDatabase.request_quota
VuforiaDatabase.reco_threshold
VuforiaDatabase.current_month_recos
VuforiaDatabase.previous_month_recos
VuforiaDatabase.total_recos
VuforiaDatabase.target_quota
States
Target
- 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-encoding
headersContent-Encoding
headers- NGINX Error cases
- Result codes
Content-Length
headers- Header cases
- Versioning, Support and API Stability
- Contributing to vws-python-mock