mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Add support for pairing devices with hubs (#859)
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user