Metadata-Version: 2.1
Name: vws-python-mock
Version: 2024.2.16
Summary: A mock for the Vuforia Web Services (VWS) API.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License: The MIT License
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
        
Project-URL: Documentation, https://vws-python-mock.readthedocs.io
Project-URL: Source, https://github.com/VWS-Python/vws-python-mock
Keywords: client,fake,mock,vuforia,vws
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Pytest
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: flask
Requires-Dist: Pillow
Requires-Dist: piq
Requires-Dist: pydantic-settings
Requires-Dist: requests
Requires-Dist: requests-mock
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: vws-auth-tools
Requires-Dist: Werkzeug
Requires-Dist: tzdata ; sys_platform == "win32"
Provides-Extra: dev
Requires-Dist: actionlint-py ==1.6.26.11 ; extra == 'dev'
Requires-Dist: check-manifest ==0.49 ; extra == 'dev'
Requires-Dist: dirty-equals ==0.7.1.post0 ; extra == 'dev'
Requires-Dist: doc8 ==1.1.1 ; extra == 'dev'
Requires-Dist: docker ==7.0.0 ; extra == 'dev'
Requires-Dist: dodgy ==0.2.1 ; extra == 'dev'
Requires-Dist: enum-tools[sphinx] ==0.11 ; extra == 'dev'
Requires-Dist: freezegun ==1.4.0 ; extra == 'dev'
Requires-Dist: furo ==2024.1.29 ; extra == 'dev'
Requires-Dist: mypy ==1.8.0 ; extra == 'dev'
Requires-Dist: pdm ==2.12.3 ; extra == 'dev'
Requires-Dist: pip-check-reqs ==2.5.3 ; extra == 'dev'
Requires-Dist: pydocstyle ==6.3 ; extra == 'dev'
Requires-Dist: pyenchant ==3.2.2 ; extra == 'dev'
Requires-Dist: pylint ==3.0.3 ; extra == 'dev'
Requires-Dist: pyproject-fmt ==1.7.0 ; extra == 'dev'
Requires-Dist: pyright ==1.1.350 ; extra == 'dev'
Requires-Dist: pyroma ==4.2 ; extra == 'dev'
Requires-Dist: pytest ==8.0.0 ; extra == 'dev'
Requires-Dist: pytest-cov ==4.1 ; extra == 'dev'
Requires-Dist: pytest-retry ==1.6.2 ; extra == 'dev'
Requires-Dist: pytest-xdist ==3.5.0 ; extra == 'dev'
Requires-Dist: python-dotenv ==1.0.1 ; extra == 'dev'
Requires-Dist: PyYAML ==6.0.1 ; extra == 'dev'
Requires-Dist: requests-mock-flask ==2023.5.14 ; extra == 'dev'
Requires-Dist: ruff ==0.2.1 ; extra == 'dev'
Requires-Dist: Sphinx ==7.2.6 ; extra == 'dev'
Requires-Dist: sphinx-prompt ==1.8 ; extra == 'dev'
Requires-Dist: Sphinx-Substitution-Extensions ==2022.2.16 ; extra == 'dev'
Requires-Dist: sphinx-toolbox ==3.5 ; extra == 'dev'
Requires-Dist: sphinx-paramlinks ==0.6 ; extra == 'dev'
Requires-Dist: sphinxcontrib-httpdomain ==1.8.1 ; extra == 'dev'
Requires-Dist: sphinxcontrib-spelling ==8 ; extra == 'dev'
Requires-Dist: sybil ==6.0.3 ; extra == 'dev'
Requires-Dist: tenacity ==8.2.3 ; extra == 'dev'
Requires-Dist: types-Pillow ==10.2.0.20240213 ; extra == 'dev'
Requires-Dist: types-PyYAML ==6.0.12.12 ; extra == 'dev'
Requires-Dist: types-requests ==2.31.0.20240125 ; extra == 'dev'
Requires-Dist: urllib3 ==2.2.0 ; extra == 'dev'
Requires-Dist: vulture ==2.11 ; extra == 'dev'
Requires-Dist: vws-python ==2024.2.6 ; extra == 'dev'
Requires-Dist: VWS-Test-Fixtures ==2023.3.5 ; extra == 'dev'
Requires-Dist: vws-web-tools ==2023.12.26 ; extra == 'dev'

|Build Status| |codecov| |PyPI| |Documentation Status|

VWS Mock
========

.. contents::
   :local:

Mock for the Vuforia Web Services (VWS) API and the Vuforia Web Query API.

Mocking calls made to Vuforia with Python ``requests``
------------------------------------------------------

Using the mock redirects requests to Vuforia made with `requests`_ to an in-memory implementation.

This requires Python 3.12+.

.. code:: sh

    pip install vws-python-mock

.. code-block:: python

    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('https://vws.vuforia.com/summary')

By default, an exception will be raised if any requests to unmocked addresses are made.

.. _requests: https://pypi.org/project/requests/

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 the `the instructions <https://vws-python-mock.readthedocs.io/en/latest/docker.html>`__ for how to do this.

Full documentation
------------------

See the `full documentation <https://vws-python-mock.readthedocs.io/en/latest>`__.
This includes details on how to use the mock, options, and details of the differences between the mock and the real Vuforia Web Services.


.. |Build Status| image:: https://github.com/VWS-Python/vws-python-mock/workflows/CI/badge.svg
   :target: https://github.com/VWS-Python/vws-python-mock/actions
.. |codecov| image:: https://codecov.io/gh/VWS-Python/vws-python-mock/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/VWS-Python/vws-python-mock
.. |PyPI| image:: https://badge.fury.io/py/VWS-Python-Mock.svg
    :target: https://badge.fury.io/py/VWS-Python-Mock
.. |Documentation Status| image:: https://readthedocs.org/projects/vws-python-mock/badge/?version=latest
   :target: https://vws-python-mock.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status
