generated from john/python-template
This commit is contained in:
@@ -152,7 +152,7 @@ async def test_document_print_projection_uses_semantic_author_and_current_text(d
|
||||
await jobs.create_job(
|
||||
Job(
|
||||
document_id=document.id,
|
||||
status=JobStatus.COMPLETED,
|
||||
status=JobStatus.TRANSCRIBED,
|
||||
provider="openrouter",
|
||||
model="model-a",
|
||||
prompt_name="transcribe_document.md",
|
||||
@@ -167,4 +167,4 @@ async def test_document_print_projection_uses_semantic_author_and_current_text(d
|
||||
assert [source.page_number for source in projection.sources] == [1, 2]
|
||||
assert [source.current_text for source in projection.sources] == ["raw first", "revised second"]
|
||||
assert [source.media_type for source in projection.sources] == ["image/png", "image/png"]
|
||||
assert projection.jobs[0].status == "completed"
|
||||
assert projection.jobs[0].status == "transcribed"
|
||||
|
||||
@@ -95,12 +95,15 @@ class TestWorkflowReliability:
|
||||
|
||||
async with services.jobs._session_scope() as session:
|
||||
attempts = (
|
||||
await session.execute(
|
||||
select(ExecutionAttempt).where(
|
||||
col(ExecutionAttempt.job_source_id).in_([js.id for js in result.job_sources])
|
||||
(
|
||||
await session.exec(
|
||||
select(ExecutionAttempt).where(
|
||||
col(ExecutionAttempt.job_source_id).in_([js.id for js in result.job_sources])
|
||||
)
|
||||
)
|
||||
)
|
||||
).scalars().all()
|
||||
.all()
|
||||
)
|
||||
error_detail = next(attempt.error_detail for attempt in attempts if attempt.error_detail is not None)
|
||||
assert "timed out" in error_detail.lower()
|
||||
assert "20.0s" in error_detail
|
||||
|
||||
@@ -141,7 +141,7 @@ class TestJobModel:
|
||||
assert job.date_created is not None
|
||||
assert job.date_updated is not None
|
||||
|
||||
def test_transitions_to_completed(self, session):
|
||||
def test_transitions_to_transcribed(self, session):
|
||||
document = _persist_document(session)
|
||||
job = _persist_job(session, document)
|
||||
|
||||
@@ -150,12 +150,12 @@ class TestJobModel:
|
||||
session.commit()
|
||||
session.refresh(job)
|
||||
|
||||
job.status = JobStatus.COMPLETED
|
||||
job.status = JobStatus.TRANSCRIBED
|
||||
session.add(job)
|
||||
session.commit()
|
||||
session.refresh(job)
|
||||
|
||||
assert job.status == JobStatus.COMPLETED
|
||||
assert job.status == JobStatus.TRANSCRIBED
|
||||
|
||||
|
||||
class TestSourceModel:
|
||||
|
||||
@@ -148,7 +148,7 @@ class TestJobsPageRendering:
|
||||
assert "Delete is blocked while the job is processing." in response.text
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_job_delete_page_allows_deletion_for_queued_or_completed_job(
|
||||
async def test_job_delete_page_allows_deletion_for_queued_job(
|
||||
self, app_client, seed_document_with_unlinked_job
|
||||
):
|
||||
_, client = app_client
|
||||
|
||||
Reference in New Issue
Block a user