Skip to content

Commit e3d1737

Browse files
committed
Expand README
1 parent 6c4636f commit e3d1737

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

README.rst

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pytest-argus-server
1414
:target: https://github.com/Uninett/pytest-argus-server/actions/workflows/main.yml
1515
:alt: See Build Status on GitHub Actions
1616

17-
A plugin that provides a running Argus API server for tests
17+
A `pytest`_ plugin that provides a running `Argus`_ API server for tests.
1818

1919
----
2020

@@ -24,14 +24,12 @@ This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`
2424
Features
2525
--------
2626

27-
* TODO
28-
27+
* Fixtures that will provide tests with a running Argus API server (using Docker Compose)
2928

3029
Requirements
3130
------------
3231

33-
* TODO
34-
32+
* `Docker Compose`_
3533

3634
Installation
3735
------------
@@ -44,7 +42,32 @@ You can install "pytest-argus-server" via `pip`_ from `PyPI`_::
4442
Usage
4543
-----
4644

47-
* TODO
45+
Installing this package will automatically make it available in `pytest`_.
46+
47+
Extra pytest command line arguments
48+
+++++++++++++++++++++++++++++++++++
49+
50+
By default, this plugin will run the *latest available* Argus server Docker
51+
image. The actually deployed version can be controlled by adding the
52+
``--argus-version`` command line option to pytest::
53+
54+
pytest --argus-version=1.30.0 tests/
55+
56+
Provided fixtures
57+
+++++++++++++++++
58+
59+
The main fixture provided by this plugin is the session-scoped ``argus_api``.
60+
When used by a test, this will ensure an Argus server is running with a
61+
pre-made test incident source and API token, and ready to take requests. It
62+
returns a two-tuple value that provides a URL to the running API and a valid
63+
API token that can be used by the test:
64+
65+
.. code-block:: python
66+
67+
def test_url_should_be_as_expected(argus_api):
68+
url, token = argus_api
69+
assert url == "http://localhost:8000/api/v2"
70+
4871
4972
Contributing
5073
------------
@@ -62,6 +85,8 @@ Issues
6285

6386
If you encounter any problems, please `file an issue`_ along with a detailed description.
6487

88+
.. _`Argus`: https://github.com/Uninett/argus
89+
.. _`Docker Compose`: https://docs.docker.com/compose/
6590
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
6691
.. _`@hackebrot`: https://github.com/hackebrot
6792
.. _`MIT`: https://opensource.org/licenses/MIT

0 commit comments

Comments
 (0)