[checkupdates] UpdateCheckData warn if file was not found

Instead of throwing an exception.
This commit is contained in:
Jochen Sprickerhof 2021-06-09 08:19:53 +02:00
parent 2bdd569eb0
commit 69a0a7da39
2 changed files with 18 additions and 7 deletions

View file

@ -212,8 +212,11 @@ class CheckupdatesTest(unittest.TestCase):
vcs.latesttags.return_value = ['1.1.8', '1.1.9']
with mock.patch(
'pathlib.Path.read_text', lambda a: 'v1.1.9\nc10109'
) as _ignored, 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)
self.assertEqual(vername, '1.1.9')
self.assertEqual(vercode, '10109')