def test_all(self, args, engine): for o in self.OPTIONS: setattr(args, o, False) args.all = True handle_cleanup_call(args, engine) engine.assert_has_calls([mock.call.cleanup_branches(targets="tur")])
def test_no_targets(self, args, engine): for o in self.OPTIONS: setattr(args, o, False) args.all = False handle_cleanup_call(args, engine) assert engine.call_count == 0
def test_option_combinations(self, args, engine): for l in range(1, len(self.OPTIONS) + 1): for combo in itertools.combinations(self.OPTIONS, l): # reset the chosen options for o in self.OPTIONS: setattr(args, o, False) args.all = False print combo for choice in combo: setattr(args, choice, True) handle_cleanup_call(args, engine) engine.assert_has_calls([mock.call.cleanup_branches(targets="".join(combo))])