throw error when CLI appid args end with a : but no Version Code

This is already the behavior in read_app_args(), but wasn't implemented in
read_pkg_args() yet.
This commit is contained in:
Hans-Christoph Steiner 2024-05-16 11:55:01 +02:00
parent 21e91564a0
commit 0d5c7516f2
2 changed files with 21 additions and 6 deletions

View file

@ -2321,6 +2321,13 @@ class CommonTest(unittest.TestCase):
fdroidserver.common.read_pkg_args(appid_versionCode_pairs, allow_vercodes),
)
def test_read_pkg_args_errors(self):
allow_vercodes = True
with self.assertRaises(FDroidException):
fdroidserver.common.read_pkg_args(['org.fdroid.fdroid:'], allow_vercodes),
with self.assertRaises(FDroidException):
fdroidserver.common.read_pkg_args(['org.fdroid.fdroid:foo'], allow_vercodes),
def test_apk_strip_v1_signatures(self):
before = os.path.join(self.basedir, 'no_targetsdk_minsdk1_unsigned.apk')
after = os.path.join(self.testdir, 'after.apk')