mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
install: download_apk() fetchs APKs by appid based on the index
This commit is contained in:
parent
97b156a963
commit
56bed02a29
3 changed files with 152 additions and 2 deletions
|
@ -36,6 +36,7 @@ if localmodule not in sys.path:
|
|||
sys.path.insert(0, localmodule)
|
||||
|
||||
import fdroidserver.index
|
||||
import fdroidserver.install
|
||||
import fdroidserver.signindex
|
||||
import fdroidserver.common
|
||||
import fdroidserver.metadata
|
||||
|
@ -2967,6 +2968,21 @@ class CommonTest(unittest.TestCase):
|
|||
knownapks.recordapk(fake_apk, default_date=datetime.now(timezone.utc))
|
||||
self.assertEqual(knownapks.apks[fake_apk], now)
|
||||
|
||||
def test_append_filename_to_mirrors(self):
|
||||
filename = 'test.apk'
|
||||
url = 'https://example.com/fdroid/repo'
|
||||
mirrors = [{'url': url}]
|
||||
self.assertEqual(
|
||||
[{'url': url + '/' + filename}],
|
||||
fdroidserver.common.append_filename_to_mirrors(filename, mirrors),
|
||||
)
|
||||
|
||||
def test_append_filename_to_mirrors_full(self):
|
||||
filename = 'test.apk'
|
||||
mirrors = fdroidserver.common.FDROIDORG_MIRRORS
|
||||
for mirror in fdroidserver.common.append_filename_to_mirrors(filename, mirrors):
|
||||
self.assertTrue(mirror['url'].endswith('/' + filename))
|
||||
|
||||
|
||||
APKS_WITH_JAR_SIGNATURES = (
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue