Skip to content

Commit e50a531

Browse files
frenckjjlawren
andauthored
Code styling tweaks to the tests - Part 2 (home-assistant#86662)
Co-authored-by: jjlawren <[email protected]>
1 parent 7ab88fa commit e50a531

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+734
-360
lines changed

tests/components/homewizard/test_number.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def state_set(brightness):
108108
number.DOMAIN,
109109
SERVICE_SET_VALUE,
110110
{
111-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
111+
ATTR_ENTITY_ID: (
112+
"number.product_name_aabbccddeeff_status_light_brightness"
113+
),
112114
ATTR_VALUE: 50,
113115
},
114116
blocking=True,
@@ -128,7 +130,9 @@ def state_set(brightness):
128130
number.DOMAIN,
129131
SERVICE_SET_VALUE,
130132
{
131-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
133+
ATTR_ENTITY_ID: (
134+
"number.product_name_aabbccddeeff_status_light_brightness"
135+
),
132136
ATTR_VALUE: 0,
133137
},
134138
blocking=True,
@@ -171,7 +175,9 @@ async def test_brightness_level_set_catches_requesterror(
171175
number.DOMAIN,
172176
SERVICE_SET_VALUE,
173177
{
174-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
178+
ATTR_ENTITY_ID: (
179+
"number.product_name_aabbccddeeff_status_light_brightness"
180+
),
175181
ATTR_VALUE: 50,
176182
},
177183
blocking=True,
@@ -205,7 +211,9 @@ async def test_brightness_level_set_catches_disablederror(
205211
number.DOMAIN,
206212
SERVICE_SET_VALUE,
207213
{
208-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
214+
ATTR_ENTITY_ID: (
215+
"number.product_name_aabbccddeeff_status_light_brightness"
216+
),
209217
ATTR_VALUE: 50,
210218
},
211219
blocking=True,
@@ -241,7 +249,9 @@ def state_set(brightness):
241249
number.DOMAIN,
242250
SERVICE_SET_VALUE,
243251
{
244-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
252+
ATTR_ENTITY_ID: (
253+
"number.product_name_aabbccddeeff_status_light_brightness"
254+
),
245255
ATTR_VALUE: -1,
246256
},
247257
blocking=True,
@@ -252,7 +262,9 @@ def state_set(brightness):
252262
number.DOMAIN,
253263
SERVICE_SET_VALUE,
254264
{
255-
ATTR_ENTITY_ID: "number.product_name_aabbccddeeff_status_light_brightness",
265+
ATTR_ENTITY_ID: (
266+
"number.product_name_aabbccddeeff_status_light_brightness"
267+
),
256268
ATTR_VALUE: 101,
257269
},
258270
blocking=True,

tests/components/ibeacon/test_coordinator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ async def test_ignore_no_name_but_create_if_set_later(hass):
115115
BLUECHARM_BEACON_SERVICE_INFO,
116116
service_data={
117117
"00002080-0000-1000-8000-00805f9b34fb": b"j\x0c\x0e\xfe\x13U",
118-
"0000feaa-0000-1000-8000-00805f9b34fb": b" \x00\x0c\x00\x1c\x00\x00\x00\x06h\x00\x008\x10",
118+
"0000feaa-0000-1000-8000-00805f9b34fb": (
119+
b" \x00\x0c\x00\x1c\x00\x00\x00\x06h\x00\x008\x10"
120+
),
119121
},
120122
),
121123
)

tests/components/image_processing/test_init.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ async def test_face_event_call(hass, aioclient_mock):
134134

135135

136136
@patch(
137-
"homeassistant.components.demo.image_processing."
138-
"DemoImageProcessingFace.confidence",
137+
"homeassistant.components.demo.image_processing.DemoImageProcessingFace.confidence",
139138
new_callable=PropertyMock(return_value=None),
140139
)
141140
async def test_face_event_call_no_confidence(mock_config, hass, aioclient_mock):

tests/components/iqvia/test_diagnostics.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_iqvia):
180180
"LGID": 1,
181181
"Name": "OZONE",
182182
"PPM": 42,
183-
"Description": "Ozone (O3) is a odorless, colorless ....",
183+
"Description": (
184+
"Ozone (O3) is a odorless, colorless ...."
185+
),
184186
},
185187
{
186188
"LGID": 1,
@@ -192,7 +194,9 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_iqvia):
192194
"LGID": 1,
193195
"Name": "PM10",
194196
"PPM": 19,
195-
"Description": "Coarse dust particles (PM10) are 2.5 ...",
197+
"Description": (
198+
"Coarse dust particles (PM10) are 2.5 ..."
199+
),
196200
},
197201
],
198202
"Period": "0001-01-01T00:00:00",
@@ -212,13 +216,17 @@ async def test_entry_diagnostics(hass, config_entry, hass_client, setup_iqvia):
212216
"LGID": 2,
213217
"Name": "PM10",
214218
"PPM": 65,
215-
"Description": "Coarse dust particles (PM10) are 2.5 ...",
219+
"Description": (
220+
"Coarse dust particles (PM10) are 2.5 ..."
221+
),
216222
},
217223
{
218224
"LGID": 1,
219225
"Name": "OZONE",
220226
"PPM": 42,
221-
"Description": "Ozone (O3) is a odorless, colorless ...",
227+
"Description": (
228+
"Ozone (O3) is a odorless, colorless ..."
229+
),
222230
},
223231
],
224232
"Period": "0001-01-01T00:00:00",

tests/components/kraken/test_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ async def test_callrate_limit(hass, caplog):
6060
await hass.config_entries.async_setup(entry.entry_id)
6161
await hass.async_block_till_done()
6262
assert (
63-
"Exceeded the Kraken.com call rate limit. Increase the update interval to prevent this error"
64-
in caplog.text
63+
"Exceeded the Kraken.com call rate limit. Increase the update interval to"
64+
" prevent this error" in caplog.text
6565
)

tests/components/logbook/test_websocket_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ async def test_subscribe_unsubscribe_logbook_stream(
12971297
"context_entity_id": "automation.alarm",
12981298
"context_event_type": "automation_triggered",
12991299
"context_id": "ac5bd62de45711eaaeb351041eec8dd9",
1300-
"context_message": "triggered by state of " "binary_sensor.dog_food_ready",
1300+
"context_message": "triggered by state of binary_sensor.dog_food_ready",
13011301
"context_name": "Mock automation",
13021302
"context_source": "state of binary_sensor.dog_food_ready",
13031303
"context_user_id": "b400facee45711eaa9308bfd3d19e474",
@@ -1311,7 +1311,7 @@ async def test_subscribe_unsubscribe_logbook_stream(
13111311
"context_domain": "automation",
13121312
"context_entity_id": "automation.alarm",
13131313
"context_event_type": "automation_triggered",
1314-
"context_message": "triggered by state of " "binary_sensor.dog_food_ready",
1314+
"context_message": "triggered by state of binary_sensor.dog_food_ready",
13151315
"context_name": "Mock automation",
13161316
"context_source": "state of binary_sensor.dog_food_ready",
13171317
"context_user_id": "b400facee45711eaa9308bfd3d19e474",
@@ -1323,7 +1323,7 @@ async def test_subscribe_unsubscribe_logbook_stream(
13231323
"context_domain": "automation",
13241324
"context_entity_id": "automation.alarm",
13251325
"context_event_type": "automation_triggered",
1326-
"context_message": "triggered by state of " "binary_sensor.dog_food_ready",
1326+
"context_message": "triggered by state of binary_sensor.dog_food_ready",
13271327
"context_name": "Mock automation",
13281328
"context_source": "state of binary_sensor.dog_food_ready",
13291329
"context_user_id": "b400facee45711eaa9308bfd3d19e474",

tests/components/lutron_caseta/test_diagnostics.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ async def test_diagnostics(hass, hass_client) -> None:
200200
"parent_keypad": "9",
201201
},
202202
"1372": {
203-
"button_name": "Kitchen " "Pendants",
203+
"button_name": "Kitchen Pendants",
204204
"leap_button_number": 3,
205205
"led_device_id": "1362",
206206
"lutron_device_id": "1372",
@@ -214,16 +214,16 @@ async def test_diagnostics(hass, hass_client) -> None:
214214
"buttons": ["1372"],
215215
"device_info": {
216216
"identifiers": [["lutron_caseta", 66286451]],
217-
"manufacturer": "Lutron " "Electronics " "Co., " "Inc",
218-
"model": "RRST-W3RL-XX " "(SunnataKeypad)",
219-
"name": "Hallway " "Main " "Stairs " "Position 1 " "Keypad",
217+
"manufacturer": "Lutron Electronics Co., Inc",
218+
"model": "RRST-W3RL-XX (SunnataKeypad)",
219+
"name": "Hallway Main Stairs Position 1 Keypad",
220220
"suggested_area": "Hallway",
221221
"via_device": ["lutron_caseta", 1234],
222222
},
223223
"dr_device_id": ANY,
224224
"lutron_device_id": "1355",
225225
"model": "RRST-W3RL-XX",
226-
"name": "Main Stairs Position 1 " "Keypad",
226+
"name": "Main Stairs Position 1 Keypad",
227227
"serial": 66286451,
228228
"type": "SunnataKeypad",
229229
},
@@ -233,10 +233,10 @@ async def test_diagnostics(hass, hass_client) -> None:
233233
"buttons": ["111"],
234234
"device_info": {
235235
"identifiers": [["lutron_caseta", 68551522]],
236-
"manufacturer": "Lutron " "Electronics " "Co., " "Inc",
237-
"model": "PJ2-3BRL-GXX-X01 " "(Pico3ButtonRaiseLower)",
238-
"name": "Dining Room " "Pico",
239-
"suggested_area": "Dining " "Room",
236+
"manufacturer": "Lutron Electronics Co., Inc",
237+
"model": "PJ2-3BRL-GXX-X01 (Pico3ButtonRaiseLower)",
238+
"name": "Dining Room Pico",
239+
"suggested_area": "Dining Room",
240240
"via_device": ["lutron_caseta", 1234],
241241
},
242242
"dr_device_id": ANY,

0 commit comments

Comments
 (0)