Skip to content

Commit 8e0bafb

Browse files
committed
Better function names and descriptions
1 parent e93e911 commit 8e0bafb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/test_smile.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ def show_setup(location_list, device_list):
362362
_LOGGER.info(" ! no devices found in this location")
363363

364364
@staticmethod
365-
def thermostat_switcher(arg, thermostat):
366-
"""Helper function 1 for device_test()."""
365+
def th_prop_selector(arg, thermostat):
366+
"""GW_Thermostat property selector function for device_test()."""
367367
if thermostat is None:
368368
return False
369369

@@ -384,8 +384,8 @@ def thermostat_switcher(arg, thermostat):
384384
return switcher.get(arg)
385385

386386
@staticmethod
387-
def binary_switcher(arg, b_sensor):
388-
"""Helper function 2 for device_test()."""
387+
def bs_prop_selector(arg, b_sensor):
388+
"""GW_B_Sensor property selector function for device_test()."""
389389
switcher = {
390390
"attributes": b_sensor.extra_state_attributes,
391391
"icon": b_sensor.icon,
@@ -468,11 +468,11 @@ async def device_test(self, smile=pw_smile.Smile, testdata=None):
468468
continue
469469

470470
assert a_item["state"] == b_item["state"]
471-
if self.thermostat_switcher(
471+
if self.th_prop_selector(
472472
a_item["id"], thermostat
473473
):
474474
assert (
475-
self.thermostat_switcher(
475+
self.th_prop_selector(
476476
a_item["id"], thermostat
477477
)
478478
== b_item["state"]
@@ -484,15 +484,15 @@ async def device_test(self, smile=pw_smile.Smile, testdata=None):
484484
)
485485
b_sensor.update_data()
486486
assert (
487-
self.binary_switcher("state", b_sensor)
487+
self.bs_prop_selector("state", b_sensor)
488488
== b_item["state"]
489489
)
490490
else:
491491
if measure_key in data:
492492
assert data[measure_key] == measure_assert
493-
if self.thermostat_switcher(measure_key, thermostat):
493+
if self.th_prop_selector(measure_key, thermostat):
494494
assert (
495-
self.thermostat_switcher(measure_key, thermostat)
495+
self.th_prop_selector(measure_key, thermostat)
496496
== measure_assert
497497
)
498498

0 commit comments

Comments
 (0)