DV360 Mock api
The DV360 mock api is a static api that can be configured to return many reponses like the DV360 and DBM api's. The difference is the calls are not real.
Local
If you want to run locally please use a virtual environment. This can be done with pipenv. Next you can run the ./main.py file. This will start a simple flask server with all endpoints.
To be able to test make sure to add the google-credentials.json OAuth credentials to the secrets folder.
If you want to test the application you can use the make run_all_tests command. To add new tests, create a new test in the tests folder and add it to the makefile. This will ensure the tests are ran in the pipeline.
Usage
To use the mock api in your testing suite make sure to target the dv360-mock-api host. If you are using the googleapi package, you will need to change the discovery url.
This will look like the following:
service = discovery.build(
api_service,
api_version,
http=self.http,
discoveryServiceUrl=f"http://localhost:5050/discover/{api_service}/{api_version}"
)
When running the tests you will need to use the runner this will start the fake api in a seperate thread on port :5050. This will look like so:
from django.test import TestCase
from dv_mock_api import runner
class ATestCase(TestCase):
def setUp(self):
runner.create_app()
def test_some_method(self):
pass # do testing here
Metadata
Release files for dv-mock-api 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dv-mock-api-0.1.2.tar.gz | 7.5 kB | Without provenance | Details for dv-mock-api-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dv_mock_api-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for dv_mock_api-0.1.2-py3-none-any.whl |
Total release size: 21.3 kB
Release files / dv-mock-api-0.1.2.tar.gz
| Download URL | dv-mock-api-0.1.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc9422d0c21f469ad40eadb0e7872ab190b74f097fcea6afa173637fb2cb21bc
|
|
BLAKE2b-256 checksum How to use checksums |
b04f6122da2696b3ad7fb51dd08c3d76dc3a9320f77691f3e25491606c968aa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
|
Release files / dv_mock_api-0.1.2-py3-none-any.whl
| Download URL | dv_mock_api-0.1.2-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6d32ba2d7f24f58d56d5493f49bebf97d6e1c0e04e3053257fbae532b763c35
|
|
BLAKE2b-256 checksum How to use checksums |
44ace4e10899db8fc498b3424568ac416e7caf1fc94a674e5b31291d2908196f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
|
Security for dv-mock-api 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.