Build jobs queue UI for issue #8
This commit is contained in:
@@ -42,6 +42,37 @@ def test_start_reenables_manual_queue_sync(tmp_path, monkeypatch):
|
||||
assert len(main.state.list_queue_items()) == 1
|
||||
|
||||
|
||||
def test_queue_jobs_include_groups_and_manual_context(tmp_path, monkeypatch):
|
||||
main, download, _movies, _tv = configure_main(tmp_path, monkeypatch)
|
||||
batch = download / "Release" / "Season 1"
|
||||
batch.mkdir(parents=True)
|
||||
(batch / "Episode.mkv").write_bytes(b"episode")
|
||||
main.state.add_manual_batch(batch.parent)
|
||||
|
||||
main.sync_manual_queue()
|
||||
jobs = main.queue_jobs()
|
||||
|
||||
assert jobs[0]["group"] == "manual_batch"
|
||||
assert jobs[0]["relative_path"] == "Release/Season 1/Episode.mkv"
|
||||
assert jobs[0]["can_run_now"] is True
|
||||
|
||||
|
||||
def test_queue_item_retry_ignore_and_remove_actions(tmp_path, monkeypatch):
|
||||
main, _download, _movies, _tv = configure_main(tmp_path, monkeypatch)
|
||||
row = main.state.upsert_queue_item(source_type="sab", source_id="job-1", name="Release", state="failed", reason="ImportError")
|
||||
|
||||
retried = main.queue_item_action(row["id"], main.QueueItemActionRequest(action="retry"))
|
||||
assert retried["item"]["state"] == "ready"
|
||||
assert retried["item"]["reason"] == "retry requested"
|
||||
|
||||
ignored = main.queue_item_action(row["id"], main.QueueItemActionRequest(action="ignore"))
|
||||
assert ignored["item"]["state"] == "skipped"
|
||||
|
||||
removed = main.queue_item_action(row["id"], main.QueueItemActionRequest(action="remove"))
|
||||
assert removed == {"status": "removed", "id": row["id"]}
|
||||
assert main.state.get_queue_item(row["id"]) is None
|
||||
|
||||
|
||||
def test_cancel_current_stops_before_next_manual_item(tmp_path, monkeypatch):
|
||||
main, download, movies, tv = configure_main(tmp_path, monkeypatch)
|
||||
batch = download / "Release"
|
||||
|
||||
Reference in New Issue
Block a user