Update tests for libmodulemd 1.4.0

It got a little picky about allowed inputs. We need full RPM NEVRA in
all tests.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-05-02 15:36:52 +02:00
parent 182a5a399b
commit 490f079c44
2 changed files with 10 additions and 10 deletions

View File

@ -723,9 +723,9 @@ class TestCreateVariantRepo(PungiTestCase):
variant = compose.variants['Server']
variant.arch_mmds["x86_64"] = {}
variant.arch_mmds["x86_64"]["test-f27"] = variant.add_fake_module(
"test:f27:1:2017", rpm_nvrs=["pkg-1.0.0-1"])
"test:f27:1:2017", rpm_nvrs=["pkg-0:1.0.0-1.x86_64"])
variant.arch_mmds["x86_64"]["test-f28"] = variant.add_fake_module(
"test:f28:1:2017", rpm_nvrs=["pkg-2.0.0-1"])
"test:f28:1:2017", rpm_nvrs=["pkg-0:2.0.0-1.x86_64"])
def mocked_modifyrepo_cmd(repodir, mmd_path, **kwargs):
modules = Modulemd.Module.new_all_from_file(mmd_path)
@ -767,7 +767,7 @@ class TestCreateVariantRepo(PungiTestCase):
variant.arch_mmds["x86_64"]["test-f27"] = variant.add_fake_module(
"test:f27:1:2017", rpm_nvrs=["bash-0:4.3.30-2.fc21.x86_64"])
variant.arch_mmds["x86_64"]["test-f28"] = variant.add_fake_module(
"test:f28:1:2017", rpm_nvrs=["pkg-2.0.0-1"])
"test:f28:1:2017", rpm_nvrs=["pkg-0:2.0.0-1.x86_64"])
def mocked_modifyrepo_cmd(repodir, mmd_path, **kwargs):
modules = Modulemd.Module.new_all_from_file(mmd_path)

View File

@ -24,17 +24,17 @@ class TestGatherSourceModule(helpers.PungiTestCase):
self.compose = helpers.DummyCompose(self.topdir, {})
self.compose.DEBUG = False
self.mmd = self.compose.variants["Server"].add_fake_module(
"testmodule:master:1:2017", rpm_nvrs=["pkg-1.0.0-1.x86_64", "pkg-1.0.0-1.i686"])
"testmodule:master:1:2017", rpm_nvrs=["pkg-0:1.0.0-1.x86_64", "pkg-0:1.0.0-1.i686"])
mock_rpm = mock.Mock(version='1.0.0', release='1',
epoch=0, excludearch=None, exclusivearch=None,
sourcerpm='pkg-1.0.0-1', nevra='pkg-1.0.0-1.x86_64',
sourcerpm='pkg-1.0.0-1', nevra='pkg-0:1.0.0-1.x86_64',
arch="x86_64")
mock_rpm.name = 'pkg'
self.compose.variants['Server'].pkgset.rpms_by_arch['x86_64'] = [mock_rpm]
mock_rpm = mock.Mock(version='1.0.0', release='1',
epoch=0, excludearch=None, exclusivearch=None,
sourcerpm='pkg-1.0.0-1', nevra='pkg-1.0.0-1.i686',
sourcerpm='pkg-1.0.0-1', nevra='pkg-0:1.0.0-1.i686',
arch="i686")
mock_rpm.name = 'pkg'
self.compose.variants['Server'].pkgset.rpms_by_arch['i686'] = [mock_rpm]
@ -43,13 +43,13 @@ class TestGatherSourceModule(helpers.PungiTestCase):
source = GatherSourceModule(self.compose)
packages, groups = source("x86_64", self.compose.variants["Server"])
self.assertEqual(len(packages), 1)
self.assertEqual(list(packages)[0][0].nevra, "pkg-1.0.0-1.x86_64")
self.assertEqual(list(packages)[0][0].nevra, "pkg-0:1.0.0-1.x86_64")
self.assertEqual(len(groups), 0)
variant = self.compose.variants["Server"]
arch_mmd = variant.arch_mmds["x86_64"]["testmodule-master"]
self.assertEqual(set(arch_mmd.get_rpm_artifacts().get()),
set(["pkg-1.0.0-1.x86_64"]))
set(["pkg-0:1.0.0-1.x86_64"]))
def test_gather_multilib(self):
multilib = Modulemd.SimpleSet()
@ -60,13 +60,13 @@ class TestGatherSourceModule(helpers.PungiTestCase):
packages, groups = source("x86_64", self.compose.variants["Server"])
self.assertEqual(len(packages), 2)
self.assertEqual(set(package[0].nevra for package in packages),
set(["pkg-1.0.0-1.x86_64", "pkg-1.0.0-1.i686"]))
set(["pkg-0:1.0.0-1.x86_64", "pkg-0:1.0.0-1.i686"]))
self.assertEqual(len(groups), 0)
variant = self.compose.variants["Server"]
arch_mmd = variant.arch_mmds["x86_64"]["testmodule-master"]
self.assertEqual(set(arch_mmd.get_rpm_artifacts().get()),
set(["pkg-1.0.0-1.x86_64", "pkg-1.0.0-1.i686"]))
set(["pkg-0:1.0.0-1.x86_64", "pkg-0:1.0.0-1.i686"]))
def test_gather_filtered_module(self):
filter_set = Modulemd.SimpleSet()