Skip to main content

A third-party pytest plugin that provides a fixture to mock the IdNow identification service

Project description

idnow_responses

A third-party pytest plugin that provides a fixture to mock the IdNow identification service.

Installation

pip install idnow-responses

Usage

This plugin makes the idnow_responses fixture available. Typically the request to IdNow would be within the tested code and not within the test. For simplicity, it's here in the request:

import requests
import idnow_responses

idnow_responses.company_id = "Mandala"


def test_service(idnow_responses):
    company_id = "Mandala"

    # Create ident
    url = f"https://gateway.test.idnow.de/api/v1/{company_id}/identifications/foo-123-ab/start"
    response = requests.post(url)
    assert response.status_code == 200
    assert response.json() == {"id": "foo-123-ab"}

    # Get ident
    url = (
        f"https://gateway.test.idnow.de/api/v1/{company_id}/identifications/foo-123-ab"
    )
    response = requests.get(url)
    assert response.status_code == 200
    assert response.json() == {"id": "foo-123-ab"}

    # Get unknown ident
    url = f"https://gateway.test.idnow.de/api/v1/{company_id}/identifications/unknown-tx-id"
    response = requests.get(url)
    assert response.status_code == 404
    assert response.json() == {"errors": [{"cause": "OBJECT_NOT_FOUND"}]}

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

idnow_responses-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

idnow_responses-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file idnow_responses-0.0.2.tar.gz.

File metadata

  • Download URL: idnow_responses-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.20.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for idnow_responses-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4002b98a15c079b2be3a93715cee47e1a94cb051421b41e6535a53891949309a
MD5 45263ce7be8b4e6023bd56f0feb379ab
BLAKE2b-256 5f1eb6f32dc2465eecb7317acb9fbb5ede960faae8352b4e2f9929915b94b093

See more details on using hashes here.

File details

Details for the file idnow_responses-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: idnow_responses-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.20.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for idnow_responses-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d637e96b66ecd3efb5a5c4a8623267a9f2d9e1fb050249a72acff2504860e15f
MD5 6cef4d6b3868de29be81f57e75654f3a
BLAKE2b-256 37b74cede0e090d7c61e9d35e92a88d83689dcb0011466e7bd9e7f3d0fbfe200

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