How to use the aria2p.cli.subcommand_call function in aria2p

To help you get started, we’ve selected a few aria2p examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pawamoy / aria2p / tests / test_cli.py View on Github external
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"
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_call_subcommand_with_no_params():
    with Aria2Server(port=7506) as server:
        assert cli.subcommand_call(server.api, "listmethods", None) == 0
github pawamoy / aria2p / tests / test_cli.py View on Github external
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