def test_compile(self): yumbase = support.MockYumBase("main") sack = yumbase.sack comps = self.comps groups = comps.groups self.assertLength(groups, support.TOTAL_GROUPS) comps.compile(sack.query().installed()) # ensure even groups obtained before compile() have the property set: self.assertTrue(groups[0].installed) self.assertFalse(groups[1].installed)
def read_mock_comps(self, fn): comps = dnf.comps.Comps() comps.add_from_xml_filename(fn) comps.compile(self.sack.query().installed()) self._comps = comps return comps