@@ -0,0 +1,2018 @@
+import re%0Aimport pytest%0Aimport stagpy.args%0A%0Adef test_no_args(capsys):%0A    stagpy.args.parse_args(%5B%5D)()%0A    output = capsys.readouterr()%0A    expected = 'stagpy -h for usage%5Cn'%0A    assert output.out == expected%0A%0Adef test_help(capsys):%0A    with pytest.raises(SystemExit):%0A        stagpy.args.parse_args(%5B'-h'%5D)%0A    output = capsys.readouterr()%0A    expected = re.compile(%0A        r'%5Eusage:.*%5Cnread and process StagYY binary data.*'%0A        r'%5Cnpositional arguments.*%5Cnoptional arguments.*$',%0A        flags=re.DOTALL)%0A    assert expected.fullmatch(output.out)%0A%0Adef test_invalid_argument(capsys):%0A    with pytest.raises(SystemExit):%0A        stagpy.args.parse_args(%5B'-dummyinvalidarg'%5D)%0A    output = capsys.readouterr()%0A    expected = re.compile(%0A        r'%5Eusage: .*%5Cn.*error: unrecognized arguments:.*%5Cn$')%0A    assert expected.fullmatch(output.err)%0A%0Adef test_invalid_subcmd(capsys):%0A    with pytest.raises(SystemExit):%0A        stagpy.args.parse_args(%5B'dummyinvalidcmd'%5D)%0A    output = capsys.readouterr()%0A    expected = re.compile(%0A        r'%5Eusage: .*%5Cn.*error: invalid choice:.*%5Cn$')%0A    assert expected.fullmatch(output.err)%0A%0Adef test_field_subcmd():%0A    func = stagpy.args.parse_args(%5B'field'%5D)%0A    assert func is stagpy.field.cmd%0A%0Adef test_rprof_subcmd():%0A    func = stagpy.args.parse_args(%5B'rprof'%5D)%0A    assert func is stagpy.rprof.cmd%0A%0Adef test_time_cmd():%0A    func = stagpy.args.parse_args(%5B'time'%5D)%0A    assert func is stagpy.time_series.cmd%0A%0Adef test_plates_subcmd():%0A    func = stagpy.args.parse_args(%5B'plates'%5D)%0A    assert func is stagpy.plates.cmd%0A%0Adef test_info_subcmd():%0A    func = stagpy.args.parse_args(%5B'info'%5D)%0A    assert func is stagpy.commands.info_cmd%0A%0Adef test_var_subcmd():%0A    func = stagpy.args.parse_args(%5B'var'%5D)%0A    assert func is stagpy.commands.var_cmd%0A%0Adef test_version_subcmd():%0A    func = stagpy.args.parse_args(%5B'version'%5D)%0A    assert func is stagpy.commands.version_cmd%0A%0Adef test_config_subcmd():%0A    func = stagpy.args.parse_args(%5B'config'%5D)%0A    assert func is stagpy.commands.config_cmd%0A

Add tests of stagpy.args