mockdock is a dns resolver and http server usable for testing containers
Project description
mockdock
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8866a4a9e0fb0b9f083498b0d6b74216d4973ae8196382aa0e4ee4703db0f67
|
|
| MD5 |
4d12e882a96b3c999ebc03933c37f7ed
|
|
| BLAKE2b-256 |
c3fcaa082ede618f8b2dba761078dcbb2283fb3bb3d60adb759cf66d76af4dfa
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23796c6c1dc702446037d3e7a3102dcfa03bba8db38d05803a4203f3d87e9b55
|
|
| MD5 |
b41b9ec05affa1b766d8ecd6f4cd9fd4
|
|
| BLAKE2b-256 |
c8953443a5567ae0f01466fd819898f342478938d35eef33cfa72a1cb4758fda
|