Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_call_subcommand(capsys):
with Aria2Server(port=7504) as server:
assert cli.subcommand_call(server.api, "wrongMethod", []) == 1
assert (
capsys.readouterr().err == "aria2p: call: Unknown method wrongMethod.\n"
" Run 'aria2p call listmethods' to list the available methods.\n"
def test_call_subcommand_with_no_params():
with Aria2Server(port=7506) as server:
assert cli.subcommand_call(server.api, "listmethods", None) == 0
def test_call_subcommand_with_json_params():
with Aria2Server(port=7505, session=SESSIONS_DIR / "dl-aria2-1.34.0-paused.txt") as server:
assert cli.subcommand_call(server.api, "tellstatus", '["2089b05ecca3d829"]') == 0