autograder .cli .testing .verify-test-data
Verify test data by starting the specified server and testing HTTP exchanges against it.
usage: python3 -m autograder.cli.testing.verify-test-data [-h] [--version]
[--testing-mode]
[--server-output-file SERVER_OUTPUT_PATH]
[--server-stop-command SERVER_STOP_COMMAND]
[--startup-skip-identify]
[--startup-wait STARTUP_WAIT_SECS]
RUN_SERVER_COMMAND
TEST_DATA_DIR
Verify test data by starting the specified server and testing HTTP exchanges against it.
positional arguments:
RUN_SERVER_COMMAND The command to run the LMS server that will be the
target of the data generation commands.
TEST_DATA_DIR The directory to search for HTTP exchanges.
options:
-h, --help show this help message and exit
--version show program's version number and exit
testing options:
--testing-mode Run as if a test is being run (default: False).
server control:
--server-output-file SERVER_OUTPUT_PATH
Where server output will be written. Defaults to a
random temp file.
--server-stop-command SERVER_STOP_COMMAND
An optional command to stop the server. After this the
server will be sent a SIGINT and then a SIGKILL.
--startup-skip-identify
If set, startup will skip trying to identify the
server as a means of checking that the server is
started.
--startup-wait STARTUP_WAIT_SECS
The time to wait between starting the server and
sending commands (default: 10.0).
1# pylint: disable=invalid-name 2 3""" 4Verify test data by starting the specified server and testing HTTP exchanges against it. 5""" 6 7import argparse 8import sys 9 10import edq.testing.serverrunner 11 12import autograder.cli.parser 13import autograder.testing.testdata 14 15def run_cli(args: argparse.Namespace) -> int: 16 """ Run the CLI. """ 17 18 return autograder.testing.testdata.verify(args) 19 20def main() -> int: 21 """ Get a parser, parse the args, and call run. """ 22 return run_cli(_get_parser().parse_args()) 23 24def _get_parser() -> argparse.ArgumentParser: 25 """ Get the parser. """ 26 27 parser = autograder.cli.parser.get_parser(__doc__.strip()) 28 edq.testing.serverrunner.modify_parser(parser) 29 30 parser.add_argument('test_data_dir', metavar = 'TEST_DATA_DIR', 31 action = 'store', type = str, 32 help = 'The directory to search for HTTP exchanges.') 33 34 return parser 35 36if (__name__ == '__main__'): 37 sys.exit(main())
def
run_cli(args: argparse.Namespace) -> int:
16def run_cli(args: argparse.Namespace) -> int: 17 """ Run the CLI. """ 18 19 return autograder.testing.testdata.verify(args)
Run the CLI.
def
main() -> int:
21def main() -> int: 22 """ Get a parser, parse the args, and call run. """ 23 return run_cli(_get_parser().parse_args())
Get a parser, parse the args, and call run.