pungi/tests/test_pkgset_phase.py
Sergey Fokin 11d6ce19e4 init commit
Change-Id: Iaed7fa268ff73122b78406576e5d1bed6a977571
2021-01-08 15:56:32 +03: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()