Skip to main content

A plugin that provides a running Argus API server for tests

Project description

PyPI version Python versions See Build Status on GitHub Actions Code style: Ruff

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=2.7.0 tests/

Provided fixtures

The main fixtures provided by this plugin are the session-scoped argus_api_url and argus_source_system_token.

argus_api_url

When used by a test, this will ensure an Argus server is running and ready to take requests. It returns the base URL of the running API:

def test_url_should_be_as_expected(argus_api_url):
    assert argus_api_url == "http://127.0.0.1:8000/api/v2/"

argus_source_system_token

This token will create a test source system and return a valid API token for accessing the API as this test source.

def test_fetch_incidents(argus_api_url, argus_source_system_token):
    assert requests.get(
        f"{argus_api_url}/incidents/",
        headers={"Authorization": f"Token {argus_source_system_token}"}
    ).status_code == 200

Bugs

  • The port number of the launched API server is hard-coded to 8000.

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.

All code needs to be formatted and linted by ruff. The pre-commit tool is used to enforce code styles at commit-time. To enable the pre-commit hooks in your repository run:

$ pre-commit install

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

pytest_argus_server-0.3.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_argus_server-0.3.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pytest_argus_server-0.3.0.tar.gz.

File metadata

  • Download URL: pytest_argus_server-0.3.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytest_argus_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 05f7b2826f37a8dac7f76b8eb323f6f33bf4fb7ec8f0304f037b6c8daf193dd2
MD5 3a9b437ca5a257b1952e9bab4963979a
BLAKE2b-256 e54b67835625feec9bd1445b71f54d4c05f1dbe1bd53c92eb008f08108e6b895

See more details on using hashes here.

File details

Details for the file pytest_argus_server-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_argus_server-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytest_argus_server-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f94c27b4a24b548d26139eba09376010c88cd32b16731ff09981ccb2d990d6b0
MD5 546de36ed661258b6328ec4808b64514
BLAKE2b-256 aafd553b48ca7a51f8fd647001f21b1f0e44c6b4d80c9c3d5395c4dc182fd317

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page