mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 22:40:12 +01:00
test_check_for_key_collisions: test with an actual collision
Genrated with this script: https://gitlab.com/fdroid/fdroidserver/-/merge_requests/787#note_401275883
This commit is contained in:
parent
d9a6bfb0a9
commit
882f8cfe19
@ -171,10 +171,6 @@ class PublishTest(unittest.TestCase):
|
||||
common.fill_config_defaults(common.config)
|
||||
publish.config = common.config
|
||||
|
||||
# We cannot really test the negative case here as there doesn't seem
|
||||
# to be a md5 collision with text input around.
|
||||
# So we just test we don't trigger an exception here and get back the same number
|
||||
# of aliases as we put in apps.
|
||||
randomappids = [
|
||||
"org.fdroid.fdroid",
|
||||
"a.b.c",
|
||||
@ -190,6 +186,10 @@ class PublishTest(unittest.TestCase):
|
||||
allaliases = publish.check_for_key_collisions(allapps)
|
||||
self.assertEqual(len(randomappids), len(allaliases))
|
||||
|
||||
allapps = {'tof.cv.mpp': App(), 'j6mX276h': App()}
|
||||
self.assertEqual(publish.key_alias('tof.cv.mpp'), publish.key_alias('j6mX276h'))
|
||||
self.assertRaises(SystemExit, publish.check_for_key_collisions, allapps)
|
||||
|
||||
def test_create_key_if_not_existing(self):
|
||||
try:
|
||||
import jks
|
||||
|
Loading…
Reference in New Issue
Block a user