Fix animdl discovery in Docker runtime
This commit is contained in:
+25
@@ -1036,6 +1036,31 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase):
|
||||
self.assertEqual(commands[1][0], APP.app_support.ANIPY_CLI)
|
||||
self.assertIn("Fallback download completed with anipy-cli.", stored["log"])
|
||||
|
||||
def test_selected_unavailable_animdl_fails_without_start_attempt(self):
|
||||
queue = APP.DownloadQueue(
|
||||
lambda: {
|
||||
"mode": "sub",
|
||||
"quality": "best",
|
||||
"download_dir": "/tmp/example",
|
||||
"download_methods": ["animdl"],
|
||||
},
|
||||
start_worker=False,
|
||||
)
|
||||
job = queue.add({"query": "Queue Show", "title": "Queue Show", "season": "1", "episodes": "1"})
|
||||
staging_dir = queue_jobs.job_staging_dir(job)
|
||||
|
||||
with mock.patch.object(queue_jobs, "cli_executable_exists", return_value=False), mock.patch.object(
|
||||
queue_jobs.subprocess, "Popen"
|
||||
) as popen:
|
||||
queue._run_job(job)
|
||||
|
||||
stored = queue._find(job["id"])
|
||||
self.assertEqual(stored["status"], "failed")
|
||||
self.assertEqual(stored["download_backend"], "animdl")
|
||||
self.assertIn("No selected download methods are installed or executable: animdl.", stored["log"])
|
||||
self.assertFalse(staging_dir.exists())
|
||||
popen.assert_not_called()
|
||||
|
||||
def test_selected_download_methods_retry_through_animdl(self):
|
||||
queue = APP.DownloadQueue(
|
||||
lambda: {
|
||||
|
||||
Reference in New Issue
Block a user