Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Files for mockdock, version 0.8.1
Filename, size File type Python version Upload date Hashes
Filename, size mockdock-0.8.1-py3-none-any.whl (6.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mockdock-0.8.1.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page