mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
update: fix tests when running without apksigner
This commit is contained in:
parent
17dc231dc9
commit
50ca3967cc
@ -388,7 +388,6 @@ class UpdateTest(unittest.TestCase):
|
|||||||
pass # aapt is not required if androguard is present
|
pass # aapt is not required if androguard is present
|
||||||
|
|
||||||
for use_androguard in (True, False):
|
for use_androguard in (True, False):
|
||||||
print('USE_ANDROGUARD', use_androguard)
|
|
||||||
if use_androguard:
|
if use_androguard:
|
||||||
try:
|
try:
|
||||||
import androguard
|
import androguard
|
||||||
@ -407,16 +406,21 @@ class UpdateTest(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
print('USE_ANDROGUARD', use_androguard)
|
||||||
|
|
||||||
|
apksigner = fdroidserver.common.find_sdk_tools_cmd('apksigner')
|
||||||
|
if use_androguard and apksigner: # v2 parsing needs both
|
||||||
|
config['apksigner'] = apksigner
|
||||||
|
apk_info = fdroidserver.update.scan_apk('v2.only.sig_2.apk')
|
||||||
|
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
||||||
|
self.assertEqual(apk_info.get('versionName'), 'v2-only')
|
||||||
|
self.assertEqual(apk_info.get('versionCode'), 2)
|
||||||
|
|
||||||
apk_info = fdroidserver.update.scan_apk('repo/v1.v2.sig_1020.apk')
|
apk_info = fdroidserver.update.scan_apk('repo/v1.v2.sig_1020.apk')
|
||||||
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
||||||
self.assertEqual(apk_info.get('versionName'), 'v1+2')
|
self.assertEqual(apk_info.get('versionName'), 'v1+2')
|
||||||
self.assertEqual(apk_info.get('versionCode'), 1020)
|
self.assertEqual(apk_info.get('versionCode'), 1020)
|
||||||
|
|
||||||
apk_info = fdroidserver.update.scan_apk('v2.only.sig_2.apk')
|
|
||||||
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
|
||||||
self.assertEqual(apk_info.get('versionName'), 'v2-only')
|
|
||||||
self.assertEqual(apk_info.get('versionCode'), 2)
|
|
||||||
|
|
||||||
apk_info = fdroidserver.update.scan_apk('repo/souch.smsbypass_9.apk')
|
apk_info = fdroidserver.update.scan_apk('repo/souch.smsbypass_9.apk')
|
||||||
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
self.assertIsNone(apk_info.get('maxSdkVersion'))
|
||||||
self.assertEqual(apk_info.get('versionName'), '0.9')
|
self.assertEqual(apk_info.get('versionName'), '0.9')
|
||||||
|
Loading…
Reference in New Issue
Block a user