mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	🥔 add strapped IPA file and test for parse_ipa
This commit is contained in:
		
							parent
							
								
									c288317530
								
							
						
					
					
						commit
						995118bcd2
					
				
					 3 changed files with 13 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										
											BIN
										
									
								
								tests/com.fake.IpaApp_1000000000001.ipa
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								tests/com.fake.IpaApp_1000000000001.ipa
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -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):
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue