How to use the aria2p.cli.subcommand_pause 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_pause_all_subcommand_doesnt_fail_with_already_paused_downloads():
    with Aria2Server(port=7514, session=SESSIONS_DIR / "2-dl-in-queue.txt") as server:
        assert cli.subcommand_pause(server.api, do_all=True) == 0
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_pause_subcommand_already_paused(capsys):
    with Aria2Server(port=7511, session=SESSIONS_DIR / "2-dl-in-queue.txt") as server:
        assert cli.subcommand_pause(server.api, ["2089b05ecca3d829", "cca3d8292089b05e"]) == 1
        assert (
            capsys.readouterr().err
            == "GID#2089b05ecca3d829 cannot be paused now\nGID#cca3d8292089b05e cannot be paused now\n"
        )
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_pause_subcommand_one_paused(capsys):
    with Aria2Server(port=7512, session=SESSIONS_DIR / "one-active-one-paused.txt") as server:
        assert cli.subcommand_pause(server.api, ["2089b05ecca3d829", "cca3d8292089b05e"]) == 1
        assert capsys.readouterr().err == "GID#cca3d8292089b05e cannot be paused now\n"
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_pause_all_subcommand():
    with Aria2Server(port=7513) as server:
        assert cli.subcommand_pause(server.api, do_all=True) == 0