Skip to content

Commit 78323ff

Browse files
committed
Set disable=protected-access for the whole file
1 parent 80d69aa commit 78323ff

File tree

1 file changed

+64
-63
lines changed

1 file changed

+64
-63
lines changed

tests/test_smile.py

Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=protected-access
12
"""Test Plugwise Home Assistant module and generate test JSON fixtures."""
23
import asyncio
34
import importlib
@@ -286,8 +287,8 @@ async def connect(
286287
)
287288

288289
if not timeout:
289-
assert smile._timeout == 30 # pylint: disable=protected-access
290-
assert smile._domain_objects is None # pylint: disable=protected-access
290+
assert smile._timeout == 30
291+
assert smile._domain_objects is None
291292
assert smile.smile_type is None
292293

293294
# Connect to the smile
@@ -393,7 +394,7 @@ async def device_test(self, smile=pw_smile.Smile, testdata=None, preset=False):
393394
self._write_json("all_data", data)
394395
self._write_json("notifications", extra["notifications"])
395396

396-
location_list = smile._thermo_locs # pylint: disable=protected-access
397+
location_list = smile._thermo_locs
397398

398399
_LOGGER.info("Gateway id = %s", extra["gateway_id"])
399400
_LOGGER.info("Hostname = %s", smile.smile_hostname)
@@ -639,12 +640,12 @@ async def test_connect_legacy_anna(self):
639640
_LOGGER.info(" # Assert version")
640641
assert smile.smile_version[0] == "1.8.0"
641642
_LOGGER.info(" # Assert legacy")
642-
assert smile._smile_legacy # pylint: disable=protected-access
643+
assert smile._smile_legacy
643644

644645
await self.device_test(smile, testdata)
645646
_LOGGER.info(" # Assert master thermostat")
646-
assert smile._is_thermostat # pylint: disable=protected-access
647-
assert not smile._multi_thermostats # pylint: disable=protected-access
647+
assert smile._is_thermostat
648+
assert not smile._multi_thermostats
648649
assert self.active_device_present
649650
assert not self.notifications
650651

@@ -740,12 +741,12 @@ async def test_connect_legacy_anna_2(self):
740741
_LOGGER.info(" # Assert version")
741742
assert smile.smile_version[0] == "1.8.0"
742743
_LOGGER.info(" # Assert legacy")
743-
assert smile._smile_legacy # pylint: disable=protected-access
744+
assert smile._smile_legacy
744745

745746
await self.device_test(smile, testdata)
746747
_LOGGER.info(" # Assert master thermostat")
747-
assert smile._is_thermostat # pylint: disable=protected-access
748-
assert not smile._multi_thermostats # pylint: disable=protected-access
748+
assert smile._is_thermostat
749+
assert not smile._multi_thermostats
749750
assert self.active_device_present
750751
assert not self.notifications
751752

@@ -812,12 +813,12 @@ async def test_connect_smile_p1_v2(self):
812813
_LOGGER.info(" # Assert version")
813814
assert smile.smile_version[0] == "2.5.9"
814815
_LOGGER.info(" # Assert legacy")
815-
assert smile._smile_legacy # pylint: disable=protected-access
816+
assert smile._smile_legacy
816817

817818
await self.device_test(smile, testdata)
818819
_LOGGER.info(" # Assert no master thermostat")
819820
# it's not a thermostat :)
820-
assert not smile._is_thermostat # pylint: disable=protected-access
821+
assert not smile._is_thermostat
821822
assert not self.notifications
822823

823824
await smile.close_connection()
@@ -850,12 +851,12 @@ async def test_connect_smile_p1_v2_2(self):
850851
_LOGGER.info(" # Assert version")
851852
assert smile.smile_version[0] == "2.5.9"
852853
_LOGGER.info(" # Assert legacy")
853-
assert smile._smile_legacy # pylint: disable=protected-access
854+
assert smile._smile_legacy
854855

855856
await self.device_test(smile, testdata)
856857
_LOGGER.info(" # Assert no master thermostat")
857858
# it's not a thermostat :)
858-
assert not smile._is_thermostat # pylint: disable=protected-access
859+
assert not smile._is_thermostat
859860
assert not self.notifications
860861

861862
await smile.close_connection()
@@ -932,12 +933,12 @@ async def test_connect_anna_v4(self):
932933
_LOGGER.info(" # Assert version")
933934
assert smile.smile_version[0] == "4.0.15"
934935
_LOGGER.info(" # Assert no legacy")
935-
assert not smile._smile_legacy # pylint: disable=protected-access
936+
assert not smile._smile_legacy
936937

937938
await self.device_test(smile, testdata)
938939
_LOGGER.info(" # Assert master thermostat")
939-
assert smile._is_thermostat # pylint: disable=protected-access
940-
assert not smile._multi_thermostats # pylint: disable=protected-access
940+
assert smile._is_thermostat
941+
assert not smile._multi_thermostats
941942
assert self.active_device_present
942943
assert not self.notifications
943944

@@ -978,12 +979,12 @@ async def test_connect_anna_v4_no_tag(self):
978979
_LOGGER.info(" # Assert version")
979980
assert smile.smile_version[0] == "4.0.15"
980981
_LOGGER.info(" # Assert no legacy")
981-
assert not smile._smile_legacy # pylint: disable=protected-access
982+
assert not smile._smile_legacy
982983

983984
await self.device_test(smile, testdata)
984985
_LOGGER.info(" # Assert master thermostat")
985-
assert smile._is_thermostat # pylint: disable=protected-access
986-
assert not smile._multi_thermostats # pylint: disable=protected-access
986+
assert smile._is_thermostat
987+
assert not smile._multi_thermostats
987988

988989
await self.tinker_thermostat(
989990
smile,
@@ -1030,12 +1031,12 @@ async def test_connect_anna_without_boiler_fw3(self):
10301031
_LOGGER.info(" # Assert version")
10311032
assert smile.smile_version[0] == "3.1.11"
10321033
_LOGGER.info(" # Assert no legacy")
1033-
assert not smile._smile_legacy # pylint: disable=protected-access
1034+
assert not smile._smile_legacy
10341035

10351036
await self.device_test(smile, testdata)
10361037
_LOGGER.info(" # Assert master thermostat")
1037-
assert smile._is_thermostat # pylint: disable=protected-access
1038-
assert not smile._multi_thermostats # pylint: disable=protected-access
1038+
assert smile._is_thermostat
1039+
assert not smile._multi_thermostats
10391040
assert self.active_device_present
10401041
assert not self.notifications
10411042

@@ -1080,12 +1081,12 @@ async def test_connect_anna_without_boiler_fw4(self):
10801081
_LOGGER.info(" # Assert version")
10811082
assert smile.smile_version[0] == "4.0.15"
10821083
_LOGGER.info(" # Assert no legacy")
1083-
assert not smile._smile_legacy # pylint: disable=protected-access
1084+
assert not smile._smile_legacy
10841085

10851086
await self.device_test(smile, testdata)
10861087
_LOGGER.info(" # Assert master thermostat")
1087-
assert smile._is_thermostat # pylint: disable=protected-access
1088-
assert not smile._multi_thermostats # pylint: disable=protected-access
1088+
assert smile._is_thermostat
1089+
assert not smile._multi_thermostats
10891090
assert self.active_device_present
10901091
assert not self.notifications
10911092

@@ -1167,12 +1168,12 @@ async def test_connect_anna_without_boiler_fw42(self):
11671168
_LOGGER.info(" # Assert version")
11681169
assert smile.smile_version[0] == "4.2.1"
11691170
_LOGGER.info(" # Assert no legacy")
1170-
assert not smile._smile_legacy # pylint: disable=protected-access
1171+
assert not smile._smile_legacy
11711172

11721173
await self.device_test(smile, testdata)
11731174
_LOGGER.info(" # Assert master thermostat")
1174-
assert smile._is_thermostat # pylint: disable=protected-access
1175-
assert not smile._multi_thermostats # pylint: disable=protected-access
1175+
assert smile._is_thermostat
1176+
assert not smile._multi_thermostats
11761177
assert self.active_device_present
11771178
assert not self.notifications
11781179

@@ -1228,12 +1229,12 @@ async def test_connect_adam_plus_anna(self):
12281229
_LOGGER.info(" # Assert version")
12291230
assert smile.smile_version[0] == "3.0.15"
12301231
_LOGGER.info(" # Assert legacy")
1231-
assert not smile._smile_legacy # pylint: disable=protected-access
1232+
assert not smile._smile_legacy
12321233

12331234
await self.device_test(smile, testdata)
12341235
_LOGGER.info(" # Assert master thermostat")
1235-
assert smile._is_thermostat # pylint: disable=protected-access
1236-
assert not smile._multi_thermostats # pylint: disable=protected-access
1236+
assert smile._is_thermostat
1237+
assert not smile._multi_thermostats
12371238
assert self.active_device_present
12381239
assert not self.notifications
12391240

@@ -1427,12 +1428,12 @@ async def test_connect_adam_plus_anna_new(self):
14271428
_LOGGER.info(" # Assert version")
14281429
assert smile.smile_version[0] == "3.6.4"
14291430
_LOGGER.info(" # Assert legacy")
1430-
assert not smile._smile_legacy # pylint: disable=protected-access
1431+
assert not smile._smile_legacy
14311432

14321433
await self.device_test(smile, testdata)
14331434
_LOGGER.info(" # Assert master thermostat")
1434-
assert smile._is_thermostat # pylint: disable=protected-access
1435-
assert smile._multi_thermostats # pylint: disable=protected-access
1435+
assert smile._is_thermostat
1436+
assert smile._multi_thermostats
14361437
assert self.active_device_present
14371438

14381439
switch_change = await self.tinker_switch(
@@ -1574,12 +1575,12 @@ async def test_connect_adam_zone_per_device(self):
15741575
_LOGGER.info(" # Assert version")
15751576
assert smile.smile_version[0] == "3.0.15"
15761577
_LOGGER.info(" # Assert legacy")
1577-
assert not smile._smile_legacy # pylint: disable=protected-access
1578+
assert not smile._smile_legacy
15781579

15791580
await self.device_test(smile, testdata)
15801581
_LOGGER.info(" # Assert master thermostat")
1581-
assert smile._is_thermostat # pylint: disable=protected-access
1582-
assert smile._multi_thermostats # pylint: disable=protected-access
1582+
assert smile._is_thermostat
1583+
assert smile._multi_thermostats
15831584
assert self.active_device_present
15841585

15851586
assert "af82e4ccf9c548528166d38e560662a4" in self.notifications
@@ -1979,12 +1980,12 @@ async def test_connect_adam_multiple_devices_per_zone(self):
19791980
_LOGGER.info(" # Assert version")
19801981
assert smile.smile_version[0] == "3.0.15"
19811982
_LOGGER.info(" # Assert legacy")
1982-
assert not smile._smile_legacy # pylint: disable=protected-access
1983+
assert not smile._smile_legacy
19831984

19841985
await self.device_test(smile, testdata)
19851986
_LOGGER.info(" # Assert master thermostat")
1986-
assert smile._is_thermostat # pylint: disable=protected-access
1987-
assert smile._multi_thermostats # pylint: disable=protected-access
1987+
assert smile._is_thermostat
1988+
assert smile._multi_thermostats
19881989
assert self.active_device_present
19891990

19901991
assert "af82e4ccf9c548528166d38e560662a4" in self.notifications
@@ -2079,11 +2080,11 @@ async def test_connect_p1v3(self):
20792080
assert smile.smile_type == "power"
20802081
_LOGGER.info(" # Assert version")
20812082
assert smile.smile_version[0] == "3.3.6"
2082-
assert not smile._smile_legacy # pylint: disable=protected-access
2083+
assert not smile._smile_legacy
20832084

20842085
await self.device_test(smile, testdata)
20852086
# it's not a thermostat :)
2086-
assert not smile._is_thermostat # pylint: disable=protected-access
2087+
assert not smile._is_thermostat
20872088
assert not self.cooling_present
20882089
assert not self.notifications
20892090

@@ -2115,12 +2116,12 @@ async def test_connect_p1v3solarfake(self):
21152116
_LOGGER.info(" # Assert version")
21162117
assert smile.smile_version[0] == "3.3.6"
21172118
_LOGGER.info(" # Assert no legacy")
2118-
assert not smile._smile_legacy # pylint: disable=protected-access
2119+
assert not smile._smile_legacy
21192120

21202121
await self.device_test(smile, testdata)
21212122
_LOGGER.info(" # Assert nomaster thermostat")
21222123
# it's not a thermostat :)
2123-
assert not smile._is_thermostat # pylint: disable=protected-access
2124+
assert not smile._is_thermostat
21242125
assert not self.notifications
21252126

21262127
await smile.close_connection()
@@ -2169,12 +2170,12 @@ async def test_connect_p1v3_full_option(self):
21692170
_LOGGER.info(" # Assert version")
21702171
assert smile.smile_version[0] == "3.3.9"
21712172
_LOGGER.info(" # Assert legacy")
2172-
assert not smile._smile_legacy # pylint: disable=protected-access
2173+
assert not smile._smile_legacy
21732174

21742175
await self.device_test(smile, testdata)
21752176
_LOGGER.info(" # Assert no master thermostat")
21762177
# it's not a thermostat :)
2177-
assert not smile._is_thermostat # pylint: disable=protected-access
2178+
assert not smile._is_thermostat
21782179
assert not self.notifications
21792180

21802181
await smile.close_connection()
@@ -2222,13 +2223,13 @@ async def test_connect_anna_heatpump(self):
22222223
_LOGGER.info(" # Assert version")
22232224
assert smile.smile_version[0] == "4.0.15"
22242225
_LOGGER.info(" # Assert no legacy")
2225-
assert not smile._smile_legacy # pylint: disable=protected-access
2226+
assert not smile._smile_legacy
22262227

22272228
# Preset cooling_active to True, will turn to False due to the lowered outdoor temp
22282229
await self.device_test(smile, testdata, True)
22292230
_LOGGER.info(" # Assert master thermostat")
2230-
assert smile._is_thermostat # pylint: disable=protected-access
2231-
assert not smile._multi_thermostats # pylint: disable=protected-access
2231+
assert smile._is_thermostat
2232+
assert not smile._multi_thermostats
22322233
assert self.active_device_present
22332234
assert self.cooling_present
22342235
assert not self.notifications
@@ -2278,12 +2279,12 @@ async def test_connect_anna_heatpump_cooling(self):
22782279
_LOGGER.info(" # Assert version")
22792280
assert smile.smile_version[0] == "4.0.15"
22802281
_LOGGER.info(" # Assert no legacy")
2281-
assert not smile._smile_legacy # pylint: disable=protected-access
2282+
assert not smile._smile_legacy
22822283

22832284
await self.device_test(smile, testdata)
22842285
_LOGGER.info(" # Assert master thermostat")
2285-
assert smile._is_thermostat # pylint: disable=protected-access
2286-
assert not smile._multi_thermostats # pylint: disable=protected-access
2286+
assert smile._is_thermostat
2287+
assert not smile._multi_thermostats
22872288
assert self.active_device_present
22882289
assert self.cooling_present
22892290
assert not self.notifications
@@ -2311,12 +2312,12 @@ async def test_connect_adam_plus_anna_copy_with_error_domain_added(self):
23112312
_LOGGER.info(" # Assert version")
23122313
assert smile.smile_version[0] == "3.0.23"
23132314
_LOGGER.info(" # Assert legacy")
2314-
assert not smile._smile_legacy # pylint: disable=protected-access
2315+
assert not smile._smile_legacy
23152316

23162317
await self.device_test(smile, testdata, True)
23172318
_LOGGER.info(" # Assert master thermostat")
2318-
assert smile._is_thermostat # pylint: disable=protected-access
2319-
assert not smile._multi_thermostats # pylint: disable=protected-access
2319+
assert smile._is_thermostat
2320+
assert not smile._multi_thermostats
23202321

23212322
assert "3d28a20e17cb47dca210a132463721d5" in self.notifications
23222323

@@ -2504,12 +2505,12 @@ async def test_connect_stretch_v31(self):
25042505
_LOGGER.info(" # Assert version")
25052506
assert smile.smile_version[0] == "3.1.11"
25062507
_LOGGER.info(" # Assert legacy")
2507-
assert smile._smile_legacy # pylint: disable=protected-access
2508+
assert smile._smile_legacy
25082509

25092510
await self.device_test(smile, testdata)
25102511
_LOGGER.info(" # Assert no master thermostat")
25112512
# it's not a thermostat :)
2512-
assert not smile._is_thermostat # pylint: disable=protected-access
2513+
assert not smile._is_thermostat
25132514

25142515
await smile.close_connection()
25152516
await self.disconnect(server, client)
@@ -2781,12 +2782,12 @@ async def test_connect_stretch_v23(self):
27812782
_LOGGER.info(" # Assert version")
27822783
assert smile.smile_version[0] == "2.3.12"
27832784
_LOGGER.info(" # Assert legacy")
2784-
assert smile._smile_legacy # pylint: disable=protected-access
2785+
assert smile._smile_legacy
27852786

27862787
await self.device_test(smile, testdata)
27872788
_LOGGER.info(" # Assert no master thermostat")
27882789
# it's not a thermostat :)
2789-
assert not smile._is_thermostat # pylint: disable=protected-access
2790+
assert not smile._is_thermostat
27902791

27912792
switch_change = await self.tinker_switch(
27922793
smile, "2587a7fcdd7e482dab03fda256076b4b"
@@ -2830,12 +2831,12 @@ async def test_connect_stretch_v27_no_domain(self):
28302831
_LOGGER.info(" # Assert version")
28312832
assert smile.smile_version[0] == "2.7.18"
28322833
_LOGGER.info(" # Assert legacy")
2833-
assert smile._smile_legacy # pylint: disable=protected-access
2834+
assert smile._smile_legacy
28342835

28352836
await self.device_test(smile, testdata)
28362837
_LOGGER.info(" # Assert no master thermostat")
28372838
# it's not a thermostat :)
2838-
assert not smile._is_thermostat # pylint: disable=protected-access
2839+
assert not smile._is_thermostat
28392840

28402841
switch_change = await self.tinker_switch(
28412842
smile, "8b8d14b242e24cd789743c828b9a2ea9"
@@ -2886,12 +2887,12 @@ async def test_connect_p1v4(self):
28862887
_LOGGER.info(" # Assert version")
28872888
assert smile.smile_version[0] == "4.1.1"
28882889
_LOGGER.info(" # Assert legacy")
2889-
assert not smile._smile_legacy # pylint: disable=protected-access
2890+
assert not smile._smile_legacy
28902891

28912892
await self.device_test(smile, testdata)
28922893
_LOGGER.info(" # Assert no master thermostat")
28932894
# it's not a thermostat :)
2894-
assert not smile._is_thermostat # pylint: disable=protected-access
2895+
assert not smile._is_thermostat
28952896
assert not self.notifications
28962897

28972898
await smile.close_connection()

0 commit comments

Comments
 (0)