Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def assert_func(command, alias):
with pytest.raises(SystemExit) as e:
cli.main([alias])
assert e.value.code == 2
lines = err_lines(capsys)
assert lines[0].startswith("usage: aria2p " + command)
assert lines[1].endswith("the following arguments are required: gids or --all")
def test_main_returns_2_when_no_remote_running():
assert cli.main(["--port=7549"]) == 2
def test_pause_subcommand(capsys):
with Aria2Server(port=7510, session=SESSIONS_DIR / "dl-aria2-1.34.0.txt") as server:
assert cli.subcommand_pause(server.api, ["2089b05ecca3d829"]) == 0