示例#1
0
def test_command_executes_checks_does_execute_correctly():
    """Check to see if a command does run correctly and gets a non-zero return value."""
    # note that a zero-code means that the command did not work
    # this is the opposite of what is used for processes
    # but, all other GatorGrader checks return 0 on failure and 1 on success
    status_code = invoke.invoke_all_command_executes_checks("true")
    assert status_code is True
示例#2
0
def test_run_command_does_execute_correctly_would_make_output(
        reset_results_dictionary, tmpdir):
    """Check that invocation of command runs when it makes output."""
    tmpdir.mkdir("Hello1")
    tmpdir.mkdir("Hello2")
    tmpdir.mkdir("Hello3")
    assert len(tmpdir.listdir()) == 3
    directory = tmpdir.dirname + "/" + tmpdir.basename + "/"
    executed_yes = invoke.invoke_all_command_executes_checks("ls " + directory)
    assert executed_yes is True
示例#3
0
def act(main_parsed_arguments, check_remaining_arguments):
    """Perform the action for this check."""
    # extract the two arguments for this check:
    # --> command is required to specify the commit count threshold
    check_parsed_arguments = parse(check_remaining_arguments)
    # Directly run the check since at least one of the argument's for it is mandatory.
    # This means that the use of check_ExecuteCommand would have already failed by this
    # point since argparse will exit the program if a command-line argument is not provided
    command = check_parsed_arguments.command
    return [invoke.invoke_all_command_executes_checks(command)]