Adam Goldsmith
5b0c72dbef
Really should have added this to version control earlier, but was trying to fix all the pre-commit issues first...
23 lines
661 B
Python
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,
|
|
)
|