support manually adding per-build antiFeatures in metadata

For cases like the OpenVPN vuln that was recently announced, it is useful
for fdroiddata maintainers to be able to mark builds that have known
vulnerabilities.
This commit is contained in:
Hans-Christoph Steiner 2017-06-27 23:55:38 +02:00
parent 20afa0e861
commit df99c85ca6
10 changed files with 356 additions and 2 deletions

View file

@ -43,14 +43,16 @@ class MetadataTest(unittest.TestCase):
fdroidserver.common.config = config
apps = fdroidserver.metadata.read_metadata(xref=True)
for appid in ('org.smssecure.smssecure', 'org.adaway', 'org.videolan.vlc'):
for appid in ('org.smssecure.smssecure', 'org.adaway',
'org.videolan.vlc', 'com.politedroid'):
savepath = os.path.join('metadata', 'dump', appid + '.yaml')
frommeta = dict(apps[appid])
self.assertTrue(appid in apps)
with open(savepath, 'r') as f:
frompickle = yaml.load(f)
self.assertEqual(frommeta, frompickle)
# Uncomment to overwrite
# comment above assert and uncomment below to update test
# files when new metadata fields are added
# with open(savepath, 'w') as f:
# yaml.add_representer(fdroidserver.metadata.Build, _build_yaml_representer)
# yaml.dump(frommeta, f, default_flow_style=False)