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
@@ -57,7 +57,7 @@ class TestCommandLine(unittest.TestCase):
|
||||
"notify": {
|
||||
"name": "test",
|
||||
"platform": "command_line",
|
||||
"command": "echo $(cat) > {}".format(filename),
|
||||
"command": f"echo $(cat) > {filename}",
|
||||
}
|
||||
},
|
||||
)
|
||||
@@ -69,7 +69,7 @@ class TestCommandLine(unittest.TestCase):
|
||||
|
||||
with open(filename) as fil:
|
||||
# the echo command adds a line break
|
||||
assert fil.read() == "{}\n".format(message)
|
||||
assert fil.read() == f"{message}\n"
|
||||
|
||||
@patch("homeassistant.components.command_line.notify._LOGGER.error")
|
||||
def test_error_for_none_zero_exit_code(self, mock_error):
|
||||
|
||||
Reference in new issue
Block a user