How to use the aria2p.cli 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 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")
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_main_returns_2_when_no_remote_running():
    assert cli.main(["--port=7549"]) == 2
github pawamoy / aria2p / tests / test_cli.py View on Github external
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