Better error message than 'KeyError' in pungi

Jira: RHELCMP-6107

Signed-off-by: Dominik Rumian <drumian@redhat.com>
This commit is contained in:
Dominik Rumian 2021-08-12 11:03:19 +02:00 committed by lsedlar
parent 3349585d78
commit 5831d4ae1e
2 changed files with 20 additions and 13 deletions

View file

@ -1582,7 +1582,7 @@ class TestGatherPhase(helpers.PungiTestCase):
phase = gather.GatherPhase(compose, pkgset_phase)
phase.validate()
def test_validates_variants_architecture_mismatch(self):
def test_validates_variants_requiring_is_not_subset_of_required(self):
pkgset_phase = mock.Mock()
compose = helpers.DummyCompose(
self.topdir, {"variant_as_lookaside": [("Everything", "Client")]}
@ -1590,12 +1590,12 @@ class TestGatherPhase(helpers.PungiTestCase):
phase = gather.GatherPhase(compose, pkgset_phase)
with self.assertRaises(ValueError) as ctx:
phase.validate()
self.assertIn("'Everything' doesn't have", str(ctx.exception))
self.assertIn("architectures of variant 'Client'", str(ctx.exception))
def test_validates_variants_architecture_match(self):
def test_validates_variants_requiring_is_subset_of_required(self):
pkgset_phase = mock.Mock()
compose = helpers.DummyCompose(
self.topdir, {"variant_as_lookaside": [("Everything", "Everything")]}
self.topdir, {"variant_as_lookaside": [("Client", "Everything")]}
)
phase = gather.GatherPhase(compose, pkgset_phase)
phase.validate()