common: test abs and rel paths in get_all_gradle_and_manifests()

This commit is contained in:
Hans-Christoph Steiner 2021-04-07 12:54:20 +02:00
parent 634864f206
commit 3d69e767d8
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA
1 changed files with 6 additions and 0 deletions

View File

@ -1129,6 +1129,7 @@ class CommonTest(unittest.TestCase):
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(os.path.join('source-files', 'cn.wildfirechat.chat'))
paths = [
os.path.join('source-files', 'cn.wildfirechat.chat', 'avenginekit', 'build.gradle'),
@ -1145,6 +1146,11 @@ class CommonTest(unittest.TestCase):
]
self.assertEqual(sorted(paths), sorted(a))
abspath = os.path.join(self.basedir, 'source-files', 'realm')
p = fdroidserver.common.get_all_gradle_and_manifests(abspath)
self.assertEqual(1, len(p))
self.assertTrue(p[0].startswith(abspath))
def test_get_gradle_subdir(self):
subdirs = {
'cn.wildfirechat.chat': 'chat',