How to use the aria2p.cli.subcommand_purge 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_purge_all_subcommand():
    with Aria2Server(port=7526) as server:
        assert cli.subcommand_purge(server.api, do_all=True) == 0
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_purge_subcommand():
    with Aria2Server(port=7524, session=SESSIONS_DIR / "very-small-remote-file.txt") as server:
        while not server.api.get_download("2089b05ecca3d829").is_complete:
            time.sleep(0.2)
        assert cli.subcommand_purge(server.api, ["2089b05ecca3d829"]) == 0
github pawamoy / aria2p / tests / test_cli.py View on Github external
def test_purge_subcommand_one_failure(capsys):
    with Aria2Server(port=7525, session=SESSIONS_DIR / "small-file-and-paused-file.txt") as server:
        while not server.api.get_download("2089b05ecca3d829").is_complete:
            time.sleep(0.2)
        assert cli.subcommand_purge(server.api, ["2089b05ecca3d829", "208a3d8299b05ecc"]) == 1
        lines = err_lines(capsys)
        assert lines[1] == "Could not remove download result of GID#208a3d8299b05ecc"