コード例 #1
0
ファイル: test_cli.py プロジェクト: kongdd/aria2p
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
コード例 #2
0
ファイル: test_cli.py プロジェクト: kongdd/aria2p
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"
コード例 #3
0
ファイル: test_cli.py プロジェクト: kongdd/aria2p
def test_purge_all_subcommand():
    with Aria2Server(port=7526) as server:
        assert cli.subcommand_purge(server.api, do_all=True) == 0
コード例 #4
0
ファイル: test_cli.py プロジェクト: nullbytes1/aria2p
def test_purge_subcommand(tmp_path, port):
    with Aria2Server(tmp_path, port,
                     session="very-small-download.txt") as server:
        assert cli.subcommand_purge(server.api) == 0
コード例 #5
0
def test_purge_subcommand():
    with Aria2Server(port=7527,
                     session=SESSIONS_DIR /
                     "very-small-remote-file.txt") as server:
        assert cli.subcommand_purge(server.api) == 0