Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dv-mock-api-0.1.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dv_mock_api-0.1.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file dv-mock-api-0.1.2.tar.gz.

File metadata

  • Download URL: dv-mock-api-0.1.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for dv-mock-api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bc9422d0c21f469ad40eadb0e7872ab190b74f097fcea6afa173637fb2cb21bc
MD5 dda38158990fb29c6bb269a54ba4eca5
BLAKE2b-256 b04f6122da2696b3ad7fb51dd08c3d76dc3a9320f77691f3e25491606c968aa5

See more details on using hashes here.

File details

Details for the file dv_mock_api-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dv_mock_api-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for dv_mock_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d32ba2d7f24f58d56d5493f49bebf97d6e1c0e04e3053257fbae532b763c35
MD5 16541ce6c21ea76d98f55327485e8fc5
BLAKE2b-256 44ace4e10899db8fc498b3424568ac416e7caf1fc94a674e5b31291d2908196f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page