From 04daa7a03a34df2fb06f6d153d86e0e1b2ba15c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20P=C3=B6hn?= Date: Tue, 12 Sep 2017 18:17:46 +0200 Subject: [PATCH] test for common.get_app_id_aapt --- tests/common.TestCase | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/common.TestCase b/tests/common.TestCase index 623bb76d..9badf369 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -25,6 +25,7 @@ if localmodule not in sys.path: import fdroidserver.signindex import fdroidserver.common import fdroidserver.metadata +from fdroidserver.exception import FDroidException class CommonTest(unittest.TestCase): @@ -401,6 +402,22 @@ class CommonTest(unittest.TestCase): self.assertEqual(keytoolcertfingerprint, fdroidserver.common.apk_signer_fingerprint_short(apkfile)) + def test_get_api_id_aapt(self): + + config = dict() + fdroidserver.common.fill_config_defaults(config) + fdroidserver.common.config = config + self._set_build_tools() + config['aapt'] = fdroidserver.common.find_sdk_tools_cmd('aapt') + + appid, vercode, vername = fdroidserver.common.get_apk_id_aapt('repo/obb.main.twoversions_1101613.apk') + self.assertEqual('obb.main.twoversions', appid) + self.assertEqual('1101613', vercode) + self.assertEqual('0.1', vername) + + with self.assertRaises(FDroidException): + fdroidserver.common.get_apk_id_aapt('nope') + if __name__ == "__main__": parser = optparse.OptionParser() -- 2.30.2