Use f-strings in integrations starting with "F"and"G" (#32150)
* Use f-strings in integrations starting with F * Use f-strings in tests for integrations starting with F * Use f-strings in integrations starting with G * Use f-strings in tests for integrations starting with G * Fix pylint error * Fix broken test
This commit is contained in:
1 parent
496bd3dddf
commit
ad102b3840
59 files changed
+219
-344
No files matched your search
@@ -56,8 +56,9 @@ class TestNotifyFile(unittest.TestCase):
|
||||
):
|
||||
|
||||
mock_st.return_value.st_size = 0
|
||||
title = "{} notifications (Log started: {})\n{}\n".format(
|
||||
ATTR_TITLE_DEFAULT, dt_util.utcnow().isoformat(), "-" * 80
|
||||
title = (
|
||||
f"{ATTR_TITLE_DEFAULT} notifications "
|
||||
f"(Log started: {dt_util.utcnow().isoformat()})\n{'-' * 80}\n"
|
||||
)
|
||||
|
||||
self.hass.services.call(
|
||||
@@ -72,12 +73,12 @@ class TestNotifyFile(unittest.TestCase):
|
||||
if not timestamp:
|
||||
assert m_open.return_value.write.call_args_list == [
|
||||
call(title),
|
||||
call("{}\n".format(message)),
|
||||
call(f"{message}\n"),
|
||||
]
|
||||
else:
|
||||
assert m_open.return_value.write.call_args_list == [
|
||||
call(title),
|
||||
call("{} {}\n".format(dt_util.utcnow().isoformat(), message)),
|
||||
call(f"{dt_util.utcnow().isoformat()} {message}\n"),
|
||||
]
|
||||
|
||||
def test_notify_file(self):
|
||||
|
||||
Reference in new issue
Block a user