dockontext
context manager that runs and closes docker containers
- When integration or end-to-end test needs temporal docker container to fake remote systems, this package will help to create/close/remove the temporal docker container.
Features
- Create docker container by giving image name. The container will be named as 'docontext={name}'
- Close and remove the container when exit.
Example
pytest.fixture
import pytest
from dockontext import container_generator_from_image, Result, Config
create_container = pytest.fixture(container_generator_from_image)
def test_fixture(create_container):
config = Config(name, "alpine:latest")
container = create_container(config)
result = container.execute("echo hello", timeout: float)
assert result == Result(returncode=0, stdout="hello\n", stderr="")
TODO
- Dockerfile
- docker-compose.yml
- container group context
Free software: MIT License
Credits
- This package was created with Cookiecutter
- Also was copied and modified from the audreyr/cookiecutter-pypackage project template.
Release files for dockontext 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dockontext-0.1.3.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dockontext-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / dockontext-0.1.3.tar.gz
| Download URL | dockontext-0.1.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86586a2c002ee462210d6dba1c04c329c5042eb909dd3e3e5b1269d448cfd221
|
|
BLAKE2b-256 checksum How to use checksums |
7d1d9d4a521387942fc79a66121b151cecd28056e7efadfd3b45f50b539fca5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.8.0 Linux/4.15.0-1028-gcp
|
Release files / dockontext-0.1.3-py3-none-any.whl
| Download URL | dockontext-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2eea3b4148220fb6b7e4901d8a7c9bda5e5dab5c65eb325049eeeb80ef5188e
|
|
BLAKE2b-256 checksum How to use checksums |
b101a1d934ebb3e8154037824e0cdccb7f7e15aed14a4d49d4dba2a92b45b2d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.8.0 Linux/4.15.0-1028-gcp
|