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