scanner: safely check options, for things using this API

https://gitlab.com/fdroid/fdroidserver/-/issues/771#note_353495799
This commit is contained in:
Hans-Christoph Steiner 2020-06-03 18:34:26 +02:00
parent 75acf63efa
commit ee54dbce87
3 changed files with 3 additions and 4 deletions

View file

@ -132,7 +132,6 @@ class BuildTest(unittest.TestCase):
fdroidserver.common.fill_config_defaults(config)
fdroidserver.common.config = config
fdroidserver.build.options = mock.Mock()
fdroidserver.build.options.json = False
fdroidserver.build.options.notarball = True
fdroidserver.build.options.skipscan = False

View file

@ -36,7 +36,7 @@ class ScannerTest(unittest.TestCase):
os.chdir(self.basedir)
def test_scan_source_files(self):
fdroidserver.scanner.options = type('', (), {})()
fdroidserver.scanner.options = mock.Mock()
fdroidserver.scanner.options.json = False
source_files = os.path.join(self.basedir, 'source-files')
projects = {