Fix matching substring flavour detection

com.github.jameshnsears.quoteunquote defines flavours 'fdroid' and
'fdroidS'. The old code used flavour in line, which matches both and the
wrong one was selected.

Closes: #912
This commit is contained in:
Jochen Sprickerhof 2021-06-12 23:59:18 +02:00
parent a21c2c5ff1
commit 0fefecde1e
4 changed files with 248 additions and 1 deletions

View file

@ -1235,6 +1235,19 @@ class CommonTest(unittest.TestCase):
self.assertEqual(('1.0', '1', 'com.kunzisoft.fdroidtest.applicationidsuffix.underscore_first'),
fdroidserver.common.parse_androidmanifests(paths, app))
app = fdroidserver.metadata.App()
build = fdroidserver.metadata.Build()
build.gradle = ['fdroid']
app['Builds'] = [build]
app.id = 'com.github.jameshnsears.quoteunquote'
paths = [
os.path.join('source-files', 'com.github.jameshnsears.quoteunquote', 'build.gradle'),
]
for path in paths:
self.assertTrue(os.path.isfile(path))
self.assertEqual(('2.5.2-fdroid', '73', 'com.github.jameshnsears.quoteunquote'),
fdroidserver.common.parse_androidmanifests(paths, app))
def test_get_all_gradle_and_manifests(self):
"""Test whether the function works with relative and absolute paths"""
a = fdroidserver.common.get_all_gradle_and_manifests(Path('source-files/cn.wildfirechat.chat'))