def test_resume_subcommand_already_unpaused(capsys): with Aria2Server(port=7516, session=SESSIONS_DIR / "dl-2-aria2.txt") as server: assert cli.subcommand_resume(server.api, ["2089b05ecca3d829", "cca3d8292089b05e"]) == 1 assert ( capsys.readouterr().err == "GID#2089b05ecca3d829 cannot be unpaused now\nGID#cca3d8292089b05e cannot be unpaused now\n" )
def test_resume_subcommand_one_unpaused(tmp_path, port, capsys): with Aria2Server(tmp_path, port, session="one-active-one-paused.txt") as server: assert cli.subcommand_resume( server.api, ["0000000000000001", "0000000000000002"]) == 1 assert capsys.readouterr( ).err == "GID#0000000000000001 cannot be unpaused now\n"
def test_resume_subcommand_one_unpaused(capsys): with Aria2Server(port=7517, session=SESSIONS_DIR / "one-active-one-paused.txt") as server: assert cli.subcommand_resume( server.api, ["2089b05ecca3d829", "cca3d8292089b05e"]) == 1 assert capsys.readouterr( ).err == "GID#2089b05ecca3d829 cannot be unpaused now\n"
def test_resume_subcommand_already_unpaused(tmp_path, port, capsys): with Aria2Server(tmp_path, port, session="2-dls.txt") as server: assert cli.subcommand_resume( server.api, ["0000000000000001", "0000000000000002"]) == 1 assert ( capsys.readouterr().err == "GID#0000000000000001 cannot be unpaused now\nGID#0000000000000002 cannot be unpaused now\n" )
def test_resume_all_subcommand_doesnt_fail_with_already_active_downloads(): with Aria2Server(port=7519, session=SESSIONS_DIR / "dl-2-aria2.txt") as server: assert cli.subcommand_resume(server.api, do_all=True) == 0
def test_resume_all_subcommand(): with Aria2Server(port=7518) as server: assert cli.subcommand_resume(server.api, do_all=True) == 0
def test_resume_subcommand(capsys): with Aria2Server(port=7515, session=SESSIONS_DIR / "dl-aria2-1.34.0-paused.txt") as server: assert cli.subcommand_resume(server.api, ["2089b05ecca3d829"]) == 0
def test_resume_all_subcommand_fails(): with Aria2Server(port=7519, session=SESSIONS_DIR / "dl-2-aria2.txt") as server: assert cli.subcommand_resume(server.api, do_all=True) == 1
def test_resume_all_subcommand_doesnt_fail_with_already_active_downloads( tmp_path, port): with Aria2Server(tmp_path, port, session="2-dls.txt") as server: assert cli.subcommand_resume(server.api, do_all=True) == 0
def test_resume_all_subcommand(server): assert cli.subcommand_resume(server.api, do_all=True) == 0
def test_resume_subcommand(tmp_path, port, capsys): with Aria2Server(tmp_path, port, session="1-dl-paused.txt") as server: assert cli.subcommand_resume(server.api, ["0000000000000001"]) == 0