A plugin that provides a running Argus API server for tests
Project description
A pytest plugin that provides a running Argus API server for tests.
This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.
Features
Fixtures that will provide tests with a running Argus API server (using Docker Compose)
Requirements
Installation
You can install “pytest-argus-server” via pip from PyPI:
$ pip install pytest-argus-server
Usage
Installing this package will automatically make it available in pytest.
Extra pytest command line arguments
By default, this plugin will run the latest available Argus server Docker image. The actually deployed version can be controlled by adding the --argus-version command line option to pytest:
pytest --argus-version=1.30.0 tests/
Provided fixtures
The main fixture provided by this plugin is the session-scoped argus_api. When used by a test, this will ensure an Argus server is running with a pre-made test incident source and API token, and ready to take requests. It returns a two-tuple value that provides a URL to the running API and a valid API token that can be used by the test:
def test_url_should_be_as_expected(argus_api):
url, token = argus_api
assert url == "http://localhost:8000/api/v2"
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the Apache Software License 2.0 license, “pytest-argus-server” is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
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 pytest_argus_server-0.1.1.tar.gz.
File metadata
- Download URL: pytest_argus_server-0.1.1.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae77f9a2d6c8ef6cbdd0c941ee4e7b8f8782a73ead923ecae9ff6cc065bf3818
|
|
| MD5 |
34bb0f878cedd160ac18261c93feb88a
|
|
| BLAKE2b-256 |
8567b231e73d15684c53247734c64fe23ab4055170543dbfa5f25e16f99ef663
|
File details
Details for the file pytest_argus_server-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytest_argus_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b25092e9d740951d2fc8900b6334e6eac5f3d0a94e026767a03b3d57927d70ae
|
|
| MD5 |
ad2e96dd1f99b907ff3eabf2431d7bba
|
|
| BLAKE2b-256 |
87f75454a7f664ea2466378c4712612cc0eca7f3b2859be43c5110c2276f58f4
|