mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
add test_check_metadata_AntiFeatures
This commit is contained in:
parent
c6ad8505d4
commit
e5fda54693
1 changed files with 20 additions and 0 deletions
|
|
@ -180,6 +180,26 @@ class MetadataTest(unittest.TestCase):
|
||||||
'fake.app.id',
|
'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):
|
def test_valid_funding_yml_regex(self):
|
||||||
"""Check the regex can find all the cases"""
|
"""Check the regex can find all the cases"""
|
||||||
with (self.basedir / 'funding-usernames.yaml').open() as fp:
|
with (self.basedir / 'funding-usernames.yaml').open() as fp:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue