1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

Merge branch 'find_sdk' into 'master'

Find sdk

See merge request fdroid/fdroidserver!836
This commit is contained in:
Hans-Christoph Steiner 2020-12-09 16:57:23 +00:00
commit adcb484927
2 changed files with 6 additions and 4 deletions

View File

@ -520,8 +520,8 @@ def find_sdk_tools_cmd(cmd):
test_aapt_version(path)
return path
# did not find the command, exit with error message
if not test_sdk_exists(config):
raise FDroidException(_("Android SDK not found!"))
test_sdk_exists(config) # ignore result so None is never returned
raise FDroidException(_("Android SDK tool {cmd} found!").format(cmd=cmd))
def test_aapt_version(aapt):

View File

@ -92,10 +92,12 @@ class CommonTest(unittest.TestCase):
if os.path.exists(os.path.join(os.getenv('ANDROID_HOME'), 'tools', 'android')):
tools.append('android')
for cmd in tools:
path = fdroidserver.common.find_sdk_tools_cmd(cmd)
if path is not None:
try:
path = fdroidserver.common.find_sdk_tools_cmd(cmd)
self.assertTrue(os.path.exists(path))
self.assertTrue(os.path.isfile(path))
except fdroidserver.exception.FDroidException:
pass
def test_find_sdk_tools_cmd(self):
fdroidserver.common.config = dict()