Skip to main content

mockdock is a dns resolver and http server usable for testing containers

Project description

mockdock

Build Status

mockdock is a dns resolver and http server usable for testing containers.

mockdock can be used with the --dns argument for docker run. It can be set to resolve all dns requests to itself, thereby constituting a mock server for all dns-based http requests of the container under test.

The integration_test module under the tests directory serves as practical documentation of how mockdock can be used in a test scenario with a docker container.

format

Responses to http requests are specified as json in the format

{
	"domain.tld/path": {
		"data": "response data",
		"content-type": "text/plain",
		"code": 200
	},
	"domain.tld/path2": {
		"code": 500
	}
}

All elements in the structure are optional with the missing elements defaulting to the values set by the HttpResponse class in the mockdock.server module. The response data can be passed to the server directly in the CONFIG_DATA variable or in a file with the path passed in the CONFIG_PATH variable. The two variables are mutually exclusive, so they cannot both be specified at the same time.

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

mockdock-0.8.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

mockdock-0.8.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file mockdock-0.8.1.tar.gz.

File metadata

  • Download URL: mockdock-0.8.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.8

File hashes

Hashes for mockdock-0.8.1.tar.gz
Algorithm Hash digest
SHA256 f8866a4a9e0fb0b9f083498b0d6b74216d4973ae8196382aa0e4ee4703db0f67
MD5 4d12e882a96b3c999ebc03933c37f7ed
BLAKE2b-256 c3fcaa082ede618f8b2dba761078dcbb2283fb3bb3d60adb759cf66d76af4dfa

See more details on using hashes here.

File details

Details for the file mockdock-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: mockdock-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.8

File hashes

Hashes for mockdock-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23796c6c1dc702446037d3e7a3102dcfa03bba8db38d05803a4203f3d87e9b55
MD5 b41b9ec05affa1b766d8ecd6f4cd9fd4
BLAKE2b-256 c8953443a5567ae0f01466fd819898f342478938d35eef33cfa72a1cb4758fda

See more details on using hashes here.

Supported by

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