pungi/tests/test_pkgset_phase.py
2020-06-11 12:05:47 +00:00

25 lines
920 B
Python

# -*- coding: utf-8 -*-
from pungi.phases import pkgset
from tests import helpers
class TestPkgsetPhase(helpers.PungiTestCase):
def test_validates_pkgset_koji_scratch_tasks_only_signed(self):
cfg = {"pkgset_koji_scratch_tasks": ["123"], "sigkeys": ["sigkey"]}
compose = helpers.DummyCompose(self.topdir, cfg)
phase = pkgset.PkgsetPhase(compose)
with self.assertRaises(ValueError) as ctx:
phase.validate()
self.assertIn("Unsigned packages must be allowed", str(ctx.exception))
def test_validates_pkgset_koji_scratch_tasks_unsigned(self):
for unsigned_obj in ["", None]:
cfg = {
"pkgset_koji_scratch_tasks": ["123"],
"sigkeys": ["sigkey", unsigned_obj],
}
compose = helpers.DummyCompose(self.topdir, cfg)
phase = pkgset.PkgsetPhase(compose)
phase.validate()