unifi_access/tests/conftest.py
Adam Goldsmith 5b0c72dbef Initial Commit
Really should have added this to version control earlier, but was
trying to fix all the pre-commit issues first...
2024-11-26 12:50:13 -05:00

23 lines
661 B
Python

from typing import cast
import pytest
from unifi_access import AccessClient
host = "localhost:12445"
api_token = "EXAMPLE_TOKEN"
def pytest_addoption(parser: pytest.Parser) -> None:
parser.addoption("--live-access-host", help="Live Unifi Access Host")
parser.addoption("--live-access-api-token", help="Live Unifi Access Host")
@pytest.fixture(scope="session")
def live_access_client(request: pytest.FixtureRequest) -> AccessClient:
return AccessClient(
cast(str, request.config.getoption("--live-access-host", skip=True)),
cast(str, request.config.getoption("--live-access-api-token", skip=True)),
verify=False,
)