def test_neg_guarded_skip(self, patchqueue, guard): """Negatively-guarded patches are skipped if guard is selected""" series = patchqueue.series().splitlines(True) applied = list(planex.patchqueue.parse_patchseries(series, guard)) not_expected = [p.patch.name for p in patchqueue.patches if tst.Guard('-', guard) in p.guards and tst.Guard('+', guard) not in p.guards] self.assertTrue(all([p not in applied for p in not_expected]))
def test_pos_guarded_apply(self, patchqueue, guard): """Positively guarded patches are applied if guard is selected""" series = patchqueue.series().splitlines(True) applied = list(planex.patchqueue.parse_patchseries(series, guard)) expected = [p.patch.name for p in patchqueue.patches if tst.Guard("+", guard) in p.guards] self.assertTrue(all([p in applied for p in expected]))
def test_neg_guarded_apply(self, patchqueue, guard): """Negatively-guarded patches are applied if guard is not selected""" series = patchqueue.series().splitlines(True) applied = list(planex.patchqueue.parse_patchseries(series, guard)) expected = [p.patch.name for p in patchqueue.patches if p.has_negative_guards() and tst.Guard('-', guard) not in p.guards] self.assertTrue(all([p in applied for p in expected]))