pre-commit: run black with string normalization

This commit is contained in:
Erik Sundell
2021-11-03 23:55:34 +01:00
parent 2ba942ba76
commit e0aaa4f995
31 changed files with 700 additions and 692 deletions

View File

@@ -5,15 +5,15 @@ import logging
def test_run_subprocess_exception(mocker):
logger = logging.getLogger('tljh')
mocker.patch.object(logger, 'error')
logger = logging.getLogger("tljh")
mocker.patch.object(logger, "error")
with pytest.raises(subprocess.CalledProcessError):
utils.run_subprocess(['/bin/bash', '-c', 'echo error; exit 1'])
logger.error.assert_called_with('error\n')
utils.run_subprocess(["/bin/bash", "-c", "echo error; exit 1"])
logger.error.assert_called_with("error\n")
def test_run_subprocess(mocker):
logger = logging.getLogger('tljh')
mocker.patch.object(logger, 'debug')
utils.run_subprocess(['/bin/bash', '-c', 'echo success'])
logger.debug.assert_called_with('success\n')
logger = logging.getLogger("tljh")
mocker.patch.object(logger, "debug")
utils.run_subprocess(["/bin/bash", "-c", "echo success"])
logger.debug.assert_called_with("success\n")