Addition of IPFS CIDv1 to Index

IPFS CIDv1 is only generated for APKs and "repo files"
This commit is contained in:
pmmayero 2022-09-14 06:42:23 +00:00 committed by Jochen Sprickerhof
parent 5e31f23a96
commit 0ad45a94a8
10 changed files with 60 additions and 6 deletions

View file

@ -1508,6 +1508,20 @@ class CommonTest(unittest.TestCase):
with self.assertRaises(SyntaxError):
fdroidserver.common.calculate_math_string('1-1 # no comment')
def test_calculate_IPFS_cid_with_no_tool(self):
fdroidserver.common.config = {'ipfs_cid': None}
self.assertIsNone(fdroidserver.common.calculate_IPFS_cid('urzip.apk'))
self.assertIsNone(fdroidserver.common.calculate_IPFS_cid('FileDoesNotExist'))
@unittest.skipUnless(shutil.which('ipfs_cid'), 'calculate_IPFS_cid needs ipfs_cid')
def test_calculate_IPFS_cid(self):
fdroidserver.common.config = dict()
self.assertIsNone(fdroidserver.common.calculate_IPFS_cid('FileDoesNotExist'))
self.assertEqual(
fdroidserver.common.calculate_IPFS_cid('urzip.apk'),
"bafybeigmtgrwyvj77jaflje2rf533haeqtpu2wtwsctryjusjnsawacsam",
)
def test_deploy_build_log_with_rsync_with_id_file(self):
mocklogcontent = bytes(