feat: add isolated utility export modes
This commit is contained in:
@@ -150,6 +150,39 @@ class FreshStoreTests(StoreTestCase):
|
||||
)
|
||||
self.assertTrue(all(slot.media_state == "empty" for slot in store.list_slots()))
|
||||
|
||||
def test_export_listing_keeps_live_jobs_visible_before_recent_history(self):
|
||||
with self.open_store() as store:
|
||||
store.reserve_export_job(
|
||||
"https://www.youtube.com/watch?v=active",
|
||||
"mp4",
|
||||
None,
|
||||
None,
|
||||
max_active=5,
|
||||
job_id="active-old",
|
||||
)
|
||||
self.clock.value += 1
|
||||
for index in range(3):
|
||||
job_id = f"completed-{index}"
|
||||
store.reserve_export_job(
|
||||
f"https://www.youtube.com/watch?v={index}",
|
||||
"mp3",
|
||||
None,
|
||||
None,
|
||||
max_active=5,
|
||||
job_id=job_id,
|
||||
)
|
||||
store.mark_export_running(job_id)
|
||||
store.complete_export_job(
|
||||
job_id,
|
||||
(f"exports/audio/{job_id}/item.mp3",),
|
||||
)
|
||||
self.clock.value += 1
|
||||
|
||||
listed = store.list_export_jobs(limit=2)
|
||||
self.assertEqual(listed[0].job_id, "active-old")
|
||||
self.assertEqual(listed[0].status, "queued")
|
||||
self.assertEqual(listed[1].job_id, "completed-2")
|
||||
|
||||
def test_restart_marks_live_exports_interrupted_without_touching_slots(self):
|
||||
store = self.open_store()
|
||||
store.reserve_export_job(
|
||||
|
||||
Reference in New Issue
Block a user