Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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_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_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(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_all_subcommand():
with Aria2Server(port=7518) as server:
assert cli.subcommand_resume(server.api, do_all=True) == 0