String formatting improvements for tests (2) (#33666)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-04-05 00:33:07 +02:00
1 parent 906385172a
commit d7e9959442
19 files changed
+65 -76

No files matched your search

@@ -50,7 +50,7 @@ from tests.common import (
HTTP_SERVER_PORT = get_test_instance_port()
BRIDGE_SERVER_PORT = get_test_instance_port()
BRIDGE_URL_BASE = "http://127.0.0.1:{}".format(BRIDGE_SERVER_PORT) + "{}"
BRIDGE_URL_BASE = f"http://127.0.0.1:{BRIDGE_SERVER_PORT}" + "{}"
JSON_HEADERS = {CONTENT_TYPE: const.CONTENT_TYPE_JSON}
@@ -773,7 +773,7 @@ async def perform_put_test_on_ceiling_lights(
async def perform_get_light_state(client, entity_id, expected_status):
"""Test the getting of a light state."""
result = await client.get("/api/username/lights/{}".format(entity_id))
result = await client.get(f"/api/username/lights/{entity_id}")
assert result.status == expected_status
@@ -808,7 +808,7 @@ async def perform_put_light_state(
data[HUE_API_STATE_SAT] = saturation
result = await client.put(
"/api/username/lights/{}/state".format(entity_id),
f"/api/username/lights/{entity_id}/state",
headers=req_headers,
data=json.dumps(data).encode(),
)
+1 -1
View File
@@ -15,7 +15,7 @@ from tests.common import get_test_home_assistant, get_test_instance_port
HTTP_SERVER_PORT = get_test_instance_port()
BRIDGE_SERVER_PORT = get_test_instance_port()
BRIDGE_URL_BASE = "http://127.0.0.1:{}".format(BRIDGE_SERVER_PORT) + "{}"
BRIDGE_URL_BASE = f"http://127.0.0.1:{BRIDGE_SERVER_PORT}" + "{}"
JSON_HEADERS = {CONTENT_TYPE: const.CONTENT_TYPE_JSON}