🥔 add strapped IPA file and test for parse_ipa

This commit is contained in:
Michael Pöhn 2023-12-18 13:35:06 +01:00 committed by Hans-Christoph Steiner
parent c288317530
commit 995118bcd2
3 changed files with 13 additions and 1 deletions

View File

@ -563,7 +563,6 @@ def parse_ipa(ipa_path, file_size, sha256):
# https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring
ipa["versionCode"] = version_string_to_int(plist["CFBundleShortVersionString"])
ipa["versionName"] = plist["CFBundleShortVersionString"]
ipa["usage"] = {k: v for k, v in plist.items() if 'Usage' in k}
return ipa

Binary file not shown.

View File

@ -1922,6 +1922,19 @@ class UpdateTest(unittest.TestCase):
index['repo'][CATEGORIES_CONFIG_NAME],
)
def test_parse_ipa(self):
result = fdroidserver.update.parse_ipa('./com.fake.IpaApp_1000000000001.ipa', 'fake_size', 'fake_sha')
self.maxDiff = None
self.assertDictEqual(result, {
'apkName': 'com.fake.IpaApp_1000000000001.ipa',
'hash': 'fake_sha',
'hashType': 'sha256',
'packageName': 'org.onionshare.OnionShare',
'size': 'fake_size',
'versionCode': 1000000000001,
'versionName': '1.0.1',
})
class TestUpdateVersionStringToInt(unittest.TestCase):