lms .cli .lib .verify-test-data
Verify test data by starting the specified server and testing HTTP exchanges against it.
usage: python3 -m lms.cli.lib.verify-test-data [-h] [--version]
[--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
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 lms.cli.parser 13import lms.testing.testdata 14 15def run_cli(args: argparse.Namespace) -> int: 16 """ Run the CLI. """ 17 18 return lms.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 = lms.cli.parser.get_parser(__doc__.strip(), 28 include_server = False, 29 include_auth = False, 30 ) 31 32 edq.testing.serverrunner.modify_parser(parser) 33 34 parser.add_argument('test_data_dir', metavar = 'TEST_DATA_DIR', 35 action = 'store', type = str, 36 help = 'The directory to search for HTTP exchanges.') 37 38 return parser 39 40if (__name__ == '__main__'): 41 sys.exit(main())
def
run_cli(args: argparse.Namespace) -> int:
16def run_cli(args: argparse.Namespace) -> int: 17 """ Run the CLI. """ 18 19 return lms.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.