Пример #1
0
def test_remove_subcommand_one_failure(capsys):
    with Aria2Server(port=7521,
                     session=SESSIONS_DIR /
                     "dl-aria2-1.34.0-paused.txt") as server:
        assert cli.subcommand_remove(
            server.api, ["2089b05ecca3d829", "cca3d8292089b05e"]) == 1
        assert capsys.readouterr().err == "GID cca3d8292089b05e is not found\n"
Пример #2
0
def test_remove_all_subcommand():
    with Aria2Server(port=7522) as server:
        assert cli.subcommand_remove(server.api, do_all=True) == 0
Пример #3
0
def test_remove_subcommand():
    with Aria2Server(port=7520,
                     session=SESSIONS_DIR /
                     "dl-aria2-1.34.0-paused.txt") as server:
        assert cli.subcommand_remove(server.api, ["2089b05ecca3d829"]) == 0
Пример #4
0
def test_remove_all_subcommand(server):
    assert cli.subcommand_remove(server.api, do_all=True) == 0
Пример #5
0
def test_remove_subcommand_one_failure(tmp_path, port, capsys):
    with Aria2Server(tmp_path, port, session="1-dl-paused.txt") as server:
        assert cli.subcommand_remove(
            server.api, ["0000000000000001", "0000000000000002"]) == 1
        assert capsys.readouterr().err == "GID 0000000000000002 is not found\n"
Пример #6
0
def test_remove_subcommand(tmp_path, port):
    with Aria2Server(tmp_path, port, session="1-dl-paused.txt") as server:
        assert cli.subcommand_remove(server.api, ["0000000000000001"]) == 0