This repository has been archived on 2024-06-02. You can view files and clone it, but cannot push or open issues or pull requests.
spud-py/tests/conftest.py
Marc Cataford 17781b0eb9
All checks were successful
/ Static Analysis (push) Successful in 1m5s
/ Tests (push) Successful in 52s
feat: add status command to query the basic status meta of services
2024-04-14 00:27:55 -04:00

27 lines
603 B
Python

import click.testing
import pytest
import spud.cli
@pytest.fixture(name="sample_config")
def sample_config_fixture():
return {"api_baseurl": "http://test.url"}
@pytest.fixture(autouse=True)
def mock_default_config_path(monkeypatch, tmpdir):
monkeypatch.setattr(
spud.cli,
"DEFAULT_CONFIGURATION_PATH",
tmpdir / ".config" / "spud" / "config.json",
)
@pytest.fixture(name="invoke_cli")
def invoke_cli_fixture():
def _call_cli(args: list[str]):
runner = click.testing.CliRunner()
return runner.invoke(spud.cli.cli, args)
return _call_cli