String formatting improvements for tests (#33663)
This commit is contained in:
1 parent
1c25468b21
commit
906385172a
33 files changed
+129
-155
No files matched your search
@@ -50,7 +50,7 @@ def mocked_requests(*args, **kwargs):
|
||||
if re.match(r"^/fwo/[\w]+/[\w.]+\.json", url.path):
|
||||
return MockResponse(json.loads(load_fixture("bom_weather.json")), 200)
|
||||
|
||||
raise NotImplementedError("Unknown route {}".format(url.path))
|
||||
raise NotImplementedError(f"Unknown route {url.path}")
|
||||
|
||||
|
||||
class TestBOMWeatherSensor(unittest.TestCase):
|
||||
@@ -78,7 +78,7 @@ class TestBOMWeatherSensor(unittest.TestCase):
|
||||
]
|
||||
|
||||
for entity_id in fake_entities:
|
||||
state = self.hass.states.get("sensor.{}".format(entity_id))
|
||||
state = self.hass.states.get(f"sensor.{entity_id}")
|
||||
assert state is not None
|
||||
|
||||
@patch("requests.get", side_effect=mocked_requests)
|
||||
|
||||
Reference in new issue
Block a user