mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03: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
1 changed files with 4 additions and 4 deletions
|
|
@ -171,10 +171,6 @@ class PublishTest(unittest.TestCase):
|
||||||
common.fill_config_defaults(common.config)
|
common.fill_config_defaults(common.config)
|
||||||
publish.config = 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 = [
|
randomappids = [
|
||||||
"org.fdroid.fdroid",
|
"org.fdroid.fdroid",
|
||||||
"a.b.c",
|
"a.b.c",
|
||||||
|
|
@ -190,6 +186,10 @@ class PublishTest(unittest.TestCase):
|
||||||
allaliases = publish.check_for_key_collisions(allapps)
|
allaliases = publish.check_for_key_collisions(allapps)
|
||||||
self.assertEqual(len(randomappids), len(allaliases))
|
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):
|
def test_create_key_if_not_existing(self):
|
||||||
try:
|
try:
|
||||||
import jks
|
import jks
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue