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_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
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"
def test_remove_all_subcommand():
with Aria2Server(port=7522) as server:
assert cli.subcommand_remove(server.api, do_all=True) == 0