def test_blacklisted_args(self, runner, arg): result = runner(['-o', 'tmp', arg]) # get the 'reason' message: for tup in BLACKLISTED_ARGS: if arg in tup: reason = BLACKLISTED_ARGS[tup] assert result.exit_code == 1 # assert we got the correct reason assert strip_header(result.output) == DISALLOWED_PIP_ARGS.format(arg=arg, reason=reason)
def test_disallowed_args(self, runner, arg): """This method tests that all the potential disallowed arguments match their error messages.""" # run shiv with a disallowed argument result = runner(["-o", "tmp", arg]) # get the 'reason' message: reason = next(iter([DISALLOWED_ARGS[disallowed] for disallowed in DISALLOWED_ARGS if arg in disallowed])) assert result.exit_code == 1 # assert we got the correct reason assert DISALLOWED_PIP_ARGS.format(arg=arg, reason=reason) in result.output