Metadata-Version: 2.0
Name: seaworthy
Version: 0.1.2
Summary: Test Docker container images
Home-page: https://github.com/praekeltfoundation/seaworthy
Author: Praekelt.org SRE team
Author-email: sre@praekelt.org
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Pytest
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Requires-Dist: attrs
Requires-Dist: docker (>=2.4.0)
Requires-Dist: hyperlink
Requires-Dist: requests
Provides-Extra: docstest
Requires-Dist: doc8; extra == 'docstest'
Requires-Dist: readme-renderer; extra == 'docstest'
Requires-Dist: sphinx (>=1.6.5); extra == 'docstest'
Requires-Dist: sphinx-rtd-theme; extra == 'docstest'
Provides-Extra: pep8test
Requires-Dist: flake8; extra == 'pep8test'
Requires-Dist: flake8-import-order; extra == 'pep8test'
Requires-Dist: pep8-naming; extra == 'pep8test'
Provides-Extra: pytest
Requires-Dist: pytest (>=3.0.0); extra == 'pytest'
Provides-Extra: test
Requires-Dist: pytest (>=3.0.0); extra == 'test'
Requires-Dist: responses; extra == 'test'
Requires-Dist: testtools; extra == 'test'
Provides-Extra: test-core
Requires-Dist: responses; extra == 'test-core'
Provides-Extra: testtools
Requires-Dist: testtools; extra == 'testtools'

Seaworthy
=========

.. image:: https://img.shields.io/pypi/v/seaworthy.svg
    :target: https://pypi.python.org/pypi/seaworthy/

.. image:: https://readthedocs.org/projects/seaworthy/badge/?version=latest
    :target: http://seaworthy.readthedocs.io/en/latest/

.. image:: https://travis-ci.org/praekeltfoundation/seaworthy.svg?branch=develop
    :target: https://travis-ci.org/praekeltfoundation/seaworthy

.. image:: https://codecov.io/gh/praekeltfoundation/seaworthy/branch/develop/graph/badge.svg
    :target: https://codecov.io/gh/praekeltfoundation/seaworthy

.. badges

Seaworthy is a test harness for Docker container images. It allows you to use
Docker containers and other Docker resources as fixtures for tests written in
Python.

Seaworthy supports Python 3.4 and newer. You can find more information in the
`documentation`_.


Quick demo
----------
First install Seaworthy along with pytest using pip::

    pip install seaworthy[pytest]

Write some tests in a file, for example, ``test_echo_container.py``:

.. code-block:: python

    from seaworthy.definitions import ContainerDefinition
    from seaworthy.pytest.fixtures import resource_fixture

    container = ContainerDefinition(
        'echo', 'jmalloc/echo-server',
        wait_patterns=[r'Echo server listening on port 8080'],
        create_kwargs={'ports': {'8080': None}})
    fixture = resource_fixture(container, 'echo_container')


    def test_echo(echo_container):
        r = echo_container.http_client().get('/foo')
        assert r.status_code == 200
        assert 'HTTP/1.1 GET /foo' in r.text

Run pytest::

    pytest -v test_echo_container.py



Project status
--------------
Seaworthy should be considered alpha-level software. It is well-tested and
works well for the first few things we have used it for, but we would like to
use it for more of our Docker projects, which may require some parts of
Seaworthy to evolve further. See the `project issues`_ for known
issues/shortcomings.

The project was originally split out of the tests we wrote for our
`docker-django-bootstrap`_ project. There are examples of Seaworthy in use
there.


.. _`documentation`: http://seaworthy.readthedocs.io/en/latest/
.. _`project issues`: https://github.com/praekeltfoundation/seaworthy/issues
.. _`docker-django-bootstrap`: https://github.com/praekeltfoundation/docker-django-bootstrap


