mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-14 03:00:29 +03:00
Set ArchivePolicy based on VercodeOperation/signature
This commit is contained in:
parent
9016bb4ca0
commit
d25995c084
2 changed files with 25 additions and 0 deletions
|
|
@ -1781,6 +1781,27 @@ class UpdateTest(unittest.TestCase):
|
|||
apks, cachechanged = fdroidserver.update.process_apks({}, 'repo', knownapks, False, apps)
|
||||
self.assertEqual([], apks)
|
||||
|
||||
def test_archive_old_apks(self):
|
||||
app = fdroidserver.metadata.App()
|
||||
app.id = 'test'
|
||||
app.VercodeOperation = ['%c+1', '%c+2', '%c+3', '%c+4']
|
||||
apps = {app.id: app}
|
||||
with self.assertLogs(level='DEBUG') as cm:
|
||||
fdroidserver.update.archive_old_apks(apps, [], [], '', '', 3)
|
||||
self.assertEqual(cm.output, [
|
||||
"DEBUG:root:Checking archiving for test - apks:0, keepversions:12, archapks:0"
|
||||
])
|
||||
|
||||
app = fdroidserver.metadata.App()
|
||||
app.id = 'org.smssecure.smssecure'
|
||||
app.CurrentVersionCode = 135
|
||||
apps = {app.id: app}
|
||||
with self.assertLogs(level='DEBUG') as cm:
|
||||
fdroidserver.update.archive_old_apks(apps, [], [], '', '', 3)
|
||||
self.assertEqual(cm.output, [
|
||||
"DEBUG:root:Checking archiving for org.smssecure.smssecure - apks:0, keepversions:6, archapks:0"
|
||||
])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue