Catch exception when testing find_sdk_tools_cmd

In 1c7df94e find_sdk_tools_cmd was changed to throw an FDroidException
when the sdk tools where not found instead of returning None.
This commit is contained in:
Jochen Sprickerhof 2020-12-05 14:24:50 +01:00
parent 15a6e2d3a0
commit 5df13bcb8c
1 changed files with 4 additions and 2 deletions

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()