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.0.1.tar.gz (1.7 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.0.1-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dv-mock-api-0.0.1.tar.gz
  • Upload date:
  • Size: 1.7 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.0.1.tar.gz
Algorithm Hash digest
SHA256 88a6ae37a29e9bf798ead77014580a3194b9899e70763cf5f7e68f97e2552efe
MD5 66433800f5be99287dc3469e12e905b2
BLAKE2b-256 e019c6cb51df5470fa5e107084acb5346db38aca3ef82ada6792728080973985

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dv_mock_api-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.9 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10e32af729b04046e13d958fc1a796106dbe3c4121a4e6447669b56db90fffdb
MD5 fa1c9de82dd3443e8887d25387448d4a
BLAKE2b-256 7cb0eb285b82595d6ebae3f20b3a62454c013cb93fd45b54f301f990b1c2a7ee

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