mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Put child fixtures in subfolder (#809)
This should prevent child fixtures from hubs breaking tests due to missing discovery info. To get these devices in `filter_fixtures` include protocol string of `SMART.CHILD`.
This commit is contained in:
@@ -39,6 +39,7 @@ SmartCall = namedtuple("SmartCall", "module request should_succeed child_device_
|
||||
FixtureResult = namedtuple("FixtureResult", "filename, folder, data")
|
||||
|
||||
SMART_FOLDER = "kasa/tests/fixtures/smart/"
|
||||
SMART_CHILD_FOLDER = "kasa/tests/fixtures/smart/child/"
|
||||
IOT_FOLDER = "kasa/tests/fixtures/"
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -531,7 +532,9 @@ def get_smart_child_fixture(response):
|
||||
model += f"({region})"
|
||||
|
||||
save_filename = f"{model}_{hw_version}_{sw_version}.json"
|
||||
return FixtureResult(filename=save_filename, folder=SMART_FOLDER, data=response)
|
||||
return FixtureResult(
|
||||
filename=save_filename, folder=SMART_CHILD_FOLDER, data=response
|
||||
)
|
||||
|
||||
|
||||
async def get_smart_fixtures(device: SmartDevice, batch_size: int):
|
||||
|
Reference in New Issue
Block a user