gather: Expand multilib lists for hybrid method

If there are globs in the blacklist or whitelist, we need to expand it
to full package name.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-09-05 15:00:01 +02:00
parent 1350684c31
commit a53dc6f1bb
2 changed files with 58 additions and 1 deletions

View file

@ -128,6 +128,48 @@ class TestMethodHybrid(helpers.PungiTestCase):
self.assertEqual(m.langpacks, {"foo": set(["foo-en"])})
def test_expand_list(self):
compose = helpers.DummyCompose(self.topdir, {})
m = hybrid.GatherMethodHybrid(compose)
m.package_sets = {
"x86_64": mock.Mock(
rpms_by_arch={
"x86_64": [
MockPkg(
name="foo",
version="1",
release="2",
arch="x86_64",
epoch=0,
sourcerpm=None,
file_path=None,
),
MockPkg(
name="foo-en",
version="1",
release="2",
arch="x86_64",
epoch=0,
sourcerpm=None,
file_path=None,
),
MockPkg(
name="bar",
version="1",
release="2",
arch="x86_64",
epoch=0,
sourcerpm=None,
file_path=None,
),
]
}
)
}
expanded = m.expand_list("x86_64", ["foo*"])
self.assertItemsEqual(expanded, ["foo", "foo-en"])
class MockModule(object):
def __init__(