Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

https://badge.fury.io/py/mocker-client.svg https://codecov.io/gh/vilus/mocker_client/branch/master/graph/badge.svg https://travis-ci.org/vilus/mocker_client.svg?branch=master

python client for create/delete mocks on mock server

Example

pip install mocker-client
from mocker_client import MockServer, Mock


mock = MockServer(url='http://127.0.0.1:8080/mocker_api/mocks/').create_mock(
    {'name': 'hi', 'route': '/q', 'method': 'get', 'responses': 'Hi_1'}
)
# actions
mock.delete()
#
help(MockServer.create_mock)
create_mock(self, data)
    :param data: dict with keys:
      'name' - optional, '' by default
      'route' - for example '/some_path'
      'method' - a http method like GET, POST, PUT, etc
      'response_type' - optional, choice from ['single', 'sequence', 'cycle'], 'single' by default
      'responses' - list of dicts with keys (or just dict if response_type is single):
        'body' - response body
        'return_code' - http status code, like 200
        'headers' - dict with http headers
    :returns Mock object
#
help(MockServer.create_mocks)
create_mocks(self, list_data)
    :param list_data: list of dicts with keys:
      'name' - optional, '' by default
      'route' - for example '/some_path'
      'method' - a http method like GET, POST, PUT, etc
      'response_type' - optional, choice from ['single', 'sequence', 'cycle'], 'single' by default
      'responses' - list of dicts with keys (or just dict if response_type is single):
        'body' - response body
        'return_code' - http status code, like 200
        'headers' - dict with http headers
    :returns list of Mock objects
#
help(Mock.delete)
delete(self)
    delete mock on server and return its info - {is_expired: bool}

Metadata

Release files for mocker-client 0.0.5dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mocker-client 0.0.5dev1
File Size Uploaded
mocker_client-0.0.5dev1.tar.gz 1.8 kB Details

Release files / mocker_client-0.0.5dev1.tar.gz

Download URL mocker_client-0.0.5dev1.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ff8474f049dc859d2eb70e0469e28583cac8587e7832be13b4c372169efcf719
BLAKE2b-256 checksum
How to use checksums
6461523ad979407a4453955495b7e4ff476c5f5e2ed2d0f574322c0e5473aba3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page