enforce black code format for tests/checkupdates.TestCase

This commit is contained in:
Hans-Christoph Steiner 2022-06-28 16:10:59 +02:00 committed by linsui
parent e03915e391
commit 78b368f88b
2 changed files with 12 additions and 13 deletions

View file

@ -267,9 +267,9 @@ class CheckupdatesTest(unittest.TestCase):
vcs.latesttags.return_value = ['1.1.9', '1.1.8']
with mock.patch(
'pathlib.Path.read_text', lambda a: 'v1.1.9\nc10109'
) as _ignored, mock.patch.object(
Path, 'is_file'
) as mock_path, mock.patch('fdroidserver.common.getvcs', return_value=vcs):
) as _ignored, mock.patch.object(Path, 'is_file') as mock_path, mock.patch(
'fdroidserver.common.getvcs', return_value=vcs
):
_ignored # silence the linters
mock_path.is_file.return_falue = True
vername, vercode, _tag = fdroidserver.checkupdates.check_tags(app, None)
@ -279,9 +279,9 @@ class CheckupdatesTest(unittest.TestCase):
app.UpdateCheckData = r'b.txt|c(.*)|.|v(.*)'
with mock.patch(
'pathlib.Path.read_text', lambda a: 'v1.1.0\nc10109'
) as _ignored, mock.patch.object(
Path, 'is_file'
) as mock_path, mock.patch('fdroidserver.common.getvcs', return_value=vcs):
) as _ignored, mock.patch.object(Path, 'is_file') as mock_path, mock.patch(
'fdroidserver.common.getvcs', return_value=vcs
):
_ignored # silence the linters
mock_path.is_file.return_falue = True
vername, vercode, _tag = fdroidserver.checkupdates.check_tags(app, None)
@ -291,9 +291,9 @@ class CheckupdatesTest(unittest.TestCase):
app.UpdateCheckData = r'b.txt|c(.*)||'
with mock.patch(
'pathlib.Path.read_text', lambda a: 'v1.1.9\nc10109'
) as _ignored, mock.patch.object(
Path, 'is_file'
) as mock_path, mock.patch('fdroidserver.common.getvcs', return_value=vcs):
) as _ignored, mock.patch.object(Path, 'is_file') as mock_path, mock.patch(
'fdroidserver.common.getvcs', return_value=vcs
):
_ignored # silence the linters
mock_path.is_file.return_falue = True
vername, vercode, _tag = fdroidserver.checkupdates.check_tags(app, None)
@ -304,9 +304,9 @@ class CheckupdatesTest(unittest.TestCase):
app.UpdateCheckData = r'b.txt|c(.*)||Android-([\d.]+)'
with mock.patch(
'pathlib.Path.read_text', lambda a: 'v1.1.9\nc10109'
) as _ignored, mock.patch.object(
Path, 'is_file'
) as mock_path, mock.patch('fdroidserver.common.getvcs', return_value=vcs):
) as _ignored, mock.patch.object(Path, 'is_file') as mock_path, mock.patch(
'fdroidserver.common.getvcs', return_value=vcs
):
_ignored # silence the linters
mock_path.is_file.return_falue = True
vername, vercode, _tag = fdroidserver.checkupdates.check_tags(app, None)