Add support for pairing devices with hubs (#859)

Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
Teemu R.
2025-01-20 11:36:06 +01:00
committed by GitHub
parent 2d26f91981
commit bca5576425
16 changed files with 412 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import asyncio
import os
import sys
import warnings
from pathlib import Path
@@ -8,6 +9,9 @@ from unittest.mock import MagicMock, patch
import pytest
# TODO: this and runner fixture could be moved to tests/cli/conftest.py
from asyncclick.testing import CliRunner
from kasa import (
DeviceConfig,
SmartProtocol,
@@ -149,3 +153,12 @@ def mock_datagram_endpoint(request): # noqa: PT004
side_effect=_create_datagram_endpoint,
):
yield
@pytest.fixture
def runner():
"""Runner fixture that unsets the KASA_ environment variables for tests."""
KASA_VARS = {k: None for k, v in os.environ.items() if k.startswith("KASA_")}
runner = CliRunner(env=KASA_VARS)
return runner