mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Replace custom deviceconfig serialization with mashumaru (#1274)
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import sys
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
@@ -21,6 +22,13 @@ from .fixtureinfo import fixture_info # noqa: F401
|
||||
turn_on = pytest.mark.parametrize("turn_on", [True, False])
|
||||
|
||||
|
||||
def load_fixture(foldername, filename):
|
||||
"""Load a fixture."""
|
||||
path = Path(Path(__file__).parent / "fixtures" / foldername / filename)
|
||||
with path.open() as fdp:
|
||||
return fdp.read()
|
||||
|
||||
|
||||
async def handle_turn_on(dev, turn_on):
|
||||
if turn_on:
|
||||
await dev.turn_on()
|
||||
|
Reference in New Issue
Block a user