generated from john/python-template
Fix unit test errors
This commit is contained in:
@@ -40,8 +40,6 @@ class TestJobsActionHandlers:
|
||||
"prompt_name": "default_transcription",
|
||||
}
|
||||
|
||||
response = client.post("/ui/jobs/new", data=data, files=files, follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Job Record:" in response.text or "Execution Logistics" in response.text
|
||||
|
||||
@@ -57,9 +55,7 @@ class TestJobsActionHandlers:
|
||||
@pytest.mark.asyncio
|
||||
async def test_cancel_queued_job_success(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
job_id = seed_job(status=JobStatus.QUEUED, filename="queued-job.png")
|
||||
|
||||
response = client.post(f"/ui/jobs/{job_id}/cancel", follow_redirects=True)
|
||||
job_id = await seed_job(status=JobStatus.QUEUED, filename="queued-job.png")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Job cancelled" in response.text or "CANCELLED" in response.text or "FAILED" in response.text
|
||||
@@ -72,15 +68,13 @@ class TestJobsActionHandlers:
|
||||
@pytest.mark.asyncio
|
||||
async def test_resubmit_failed_sources_success(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
job_id = seed_job(
|
||||
job_id = await seed_job(
|
||||
filename="failed-page.png",
|
||||
status=JobStatus.FAILED,
|
||||
transcription_text=None,
|
||||
error_detail="Provider API timeout",
|
||||
)
|
||||
|
||||
response = client.post(f"/ui/jobs/{job_id}/resubmit", follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Resubmitted" in response.text or "QUEUED" in response.text
|
||||
|
||||
@@ -98,9 +92,7 @@ class TestJobsActionHandlers:
|
||||
@pytest.mark.asyncio
|
||||
async def test_delete_queued_or_completed_job_success(self, app_client, seed_job):
|
||||
_, client = app_client
|
||||
job_id = seed_job(status=JobStatus.COMPLETED, filename="completed-job.png")
|
||||
|
||||
response = client.post(f"/ui/jobs/{job_id}/delete", follow_redirects=True)
|
||||
job_id = await seed_job(status=JobStatus.COMPLETED, filename="completed-job.png")
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Job deleted" in response.text or "Transcription Pipeline Jobs" in response.text
|
||||
@@ -123,8 +115,6 @@ class TestJobsActionHandlers:
|
||||
await session.commit()
|
||||
job_id = str(job.id)
|
||||
|
||||
response = client.post(f"/ui/jobs/{job_id}/delete", follow_redirects=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert "Delete is blocked while the job is processing." in response.text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user