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

@ -49,7 +49,6 @@ force-exclude = '''(
| tests/gradle-release-checksums\.py | tests/gradle-release-checksums\.py
| tests/openssl-version-check-test\.py | tests/openssl-version-check-test\.py
| tests/valid-package-names/test\.py | tests/valid-package-names/test\.py
| tests/checkupdates\.TestCase
| tests/common\.TestCase | tests/common\.TestCase
| tests/publish\.TestCase | tests/publish\.TestCase
| tests/signatures\.TestCase | tests/signatures\.TestCase

View file

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