gather: nodeps should take packages from comps groups

When gather_method is set to nodeps, we should not ignore the comps
group that the method received. Instead it should find out which
packages are in those groups and take them into the compose.

In order for this to be of any reasonable use, the comps file needs to
include all dependencies for the packages.

Fixes: #653
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-06-21 13:35:36 +02:00
parent 0350b715dd
commit 8c48dfb93a
4 changed files with 67 additions and 1 deletions

View file

@ -41,6 +41,17 @@ class CompsWrapperTest(unittest.TestCase):
comps.get_comps_groups(),
['core', 'standard', 'text-internet', 'firefox', 'resilient-storage', 'basic-desktop'])
def test_get_packages(self):
comps = CompsWrapper(COMPS_FILE)
self.assertItemsEqual(
comps.get_packages('text-internet'),
{'dummy-elinks', 'dummy-tftp'})
def test_get_packages_for_non_existing_group(self):
comps = CompsWrapper(COMPS_FILE)
with self.assertRaises(KeyError):
comps.get_packages('foo')
def test_write_comps(self):
comps = CompsWrapper(COMPS_FILE)
comps.write_comps(target_file=self.file.name)