add test_check_metadata_AntiFeatures
This commit is contained in:
parent
c6ad8505d4
commit
e5fda54693
|
@ -180,6 +180,26 @@ class MetadataTest(unittest.TestCase):
|
|||
'fake.app.id',
|
||||
)
|
||||
|
||||
def test_check_metadata_AntiFeatures(self):
|
||||
fdroidserver.metadata.warnings_action = 'error'
|
||||
|
||||
app = fdroidserver.metadata.App()
|
||||
self.assertIsNone(metadata.check_metadata(app))
|
||||
|
||||
app['AntiFeatures'] = []
|
||||
self.assertIsNone(metadata.check_metadata(app))
|
||||
|
||||
app['AntiFeatures'] = ['Ads', 'UpstreamNonFree']
|
||||
self.assertIsNone(metadata.check_metadata(app))
|
||||
|
||||
app['AntiFeatures'] = ['Ad']
|
||||
with self.assertRaises(fdroidserver.exception.MetaDataException):
|
||||
metadata.check_metadata(app)
|
||||
|
||||
app['AntiFeatures'] = ['Adss']
|
||||
with self.assertRaises(fdroidserver.exception.MetaDataException):
|
||||
metadata.check_metadata(app)
|
||||
|
||||
def test_valid_funding_yml_regex(self):
|
||||
"""Check the regex can find all the cases"""
|
||||
with (self.basedir / 'funding-usernames.yaml').open() as fp:
|
||||
|
|
Loading…
Reference in New Issue