mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 14:30:30 +03:00
🔍 add scanner_signature_sources config option
This adds the option to configure which set of signatures `fdroid scanner` should use, by configuring it in `config.yml`. It allows fetching signatures in our custom json format. It also adds 3 additional sources: 'suss', 'exodus', 'etip'
This commit is contained in:
parent
46d077292c
commit
24d88705fa
4 changed files with 102 additions and 17 deletions
|
|
@ -656,6 +656,37 @@ class Test_SignatureDataController(unittest.TestCase):
|
|||
func_fsfw.assert_called_once_with()
|
||||
func_wtc.assert_called_once_with()
|
||||
|
||||
def test_load_try_web_when_no_defaults(self):
|
||||
sdc = fdroidserver.scanner.SignatureDataController(
|
||||
'nnn', 'fff.yml', 'https://example.com/test.json'
|
||||
)
|
||||
func_lfc = mock.Mock(
|
||||
side_effect=fdroidserver.scanner.SignatureDataCacheMissException()
|
||||
)
|
||||
func_lfd = mock.Mock(
|
||||
side_effect=fdroidserver.scanner.SignatureDataNoDefaultsException()
|
||||
)
|
||||
func_fsfw = mock.Mock()
|
||||
func_wtc = mock.Mock()
|
||||
with mock.patch(
|
||||
'fdroidserver.scanner.SignatureDataController.load_from_cache',
|
||||
func_lfc,
|
||||
), mock.patch(
|
||||
'fdroidserver.scanner.SignatureDataController.load_from_defaults',
|
||||
func_lfd,
|
||||
), mock.patch(
|
||||
'fdroidserver.scanner.SignatureDataController.fetch_signatures_from_web',
|
||||
func_fsfw,
|
||||
), mock.patch(
|
||||
'fdroidserver.scanner.SignatureDataController.write_to_cache',
|
||||
func_wtc,
|
||||
):
|
||||
sdc.load()
|
||||
func_lfc.assert_called_once_with()
|
||||
func_lfd.assert_called_once_with()
|
||||
func_fsfw.assert_called_once_with()
|
||||
func_wtc.assert_called_once_with()
|
||||
|
||||
@unittest.skipIf(
|
||||
sys.version_info < (3, 9, 0),
|
||||
"mock_open doesn't allow easy access to written data in older python versions",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue