mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 14:30:30 +03:00
test load_localized_locale() and translated Anti-Features
This commit is contained in:
parent
b04c7ff539
commit
d6dba05ec3
21 changed files with 955 additions and 3 deletions
|
|
@ -2667,6 +2667,38 @@ class CommonTest(unittest.TestCase):
|
|||
config['smartcardoptions'],
|
||||
)
|
||||
|
||||
def test_load_localized_config(self):
|
||||
"""It should load"""
|
||||
antiFeatures = fdroidserver.common.load_localized_config('antiFeatures', 'repo')
|
||||
self.assertEqual(
|
||||
[
|
||||
'Ads',
|
||||
'DisabledAlgorithm',
|
||||
'KnownVuln',
|
||||
'NSFW',
|
||||
'NoSourceSince',
|
||||
'NonFreeAdd',
|
||||
'NonFreeAssets',
|
||||
'NonFreeDep',
|
||||
'NonFreeNet',
|
||||
'Tracking',
|
||||
'UpstreamNonFree',
|
||||
],
|
||||
list(antiFeatures.keys()),
|
||||
)
|
||||
self.assertEqual(
|
||||
['de', 'en-US', 'fa', 'ro', 'zh-rCN'],
|
||||
list(antiFeatures['Ads']['description'].keys()),
|
||||
)
|
||||
self.assertEqual(
|
||||
['en-US'],
|
||||
list(antiFeatures['NoSourceSince']['description'].keys()),
|
||||
)
|
||||
# it should have copied the icon files into place
|
||||
for v in antiFeatures.values():
|
||||
p = Path(os.path.dirname(__file__) + '/repo' + v['icon']['en-US']['name'])
|
||||
self.assertTrue(p.exists())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue