GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing vws-python.github.io — vws-python-mock vws-python-mock¶Mocking calls made to Vuforia¶$ pip install vws-python-mock This requires Python 3.15+.
"""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. A """Make a request to the Vuforia mock from a decorated function.""" import requests from mock_vws import MockVWS from mock_vws.database import CloudDatabase mock = MockVWS() mock.add_cloud_database(cloud_database=CloudDatabase()) @mock def get_summary() -> None: """Make a request which uses the Vuforia mock.""" _ = requests.get(url="https://vws.vuforia.com/summary", timeout=30) get_summary() Each call of a decorated function gets its own databases and targets, so decorated functions do not affect each other.
A See API Reference for details of what can be changed and how.
"""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)
"""Make a request to the Vuforia Web Services API mock using httpx2.""" import httpx2 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. _ = httpx2.get(url="https://vws.vuforia.com/summary", timeout=30) Asynchronous Using containers to mock calls to Vuforia from any language¶You can run a Mock VWS instance using Docker or Apple’s This allows you to run tests against a mock VWS instance regardless of the language or tooling you are using. See Running a server in containers for how to do this. Reference¶
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |