Rthur2003 commited on
Commit
e6e7656
·
1 Parent(s): f4a412c

feat: core analysis pipeline ve routes için audio inspection ve XAI verdicts eklendi

Browse files
Files changed (1) hide show
  1. tests/test_analysis_jobs.py +13 -1
tests/test_analysis_jobs.py CHANGED
@@ -8,7 +8,7 @@ import pytest
8
 
9
  from app.services import analysis_jobs as aj
10
  from app.services.analysis_jobs import (
11
- FILE_STEPS, STEP_DONE, CpuGate, JobCancelled, JobStore, Progress, ResultCache,
12
  )
13
  from app.services.inference_xai import XAIInferenceService
14
 
@@ -158,3 +158,15 @@ def test_confidence_band_is_measured_from_the_threshold() -> None:
158
  assert svc._confidence_band(0.97).tier == "very_strong"
159
  assert svc._confidence_band(0.02).tier == "very_strong"
160
  assert svc._confidence_band(0.431577).margin == 0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  from app.services import analysis_jobs as aj
10
  from app.services.analysis_jobs import (
11
+ FILE_STEPS, STEP_DONE, STEP_RUNNING, CpuGate, JobCancelled, JobStore, Progress, ResultCache,
12
  )
13
  from app.services.inference_xai import XAIInferenceService
14
 
 
158
  assert svc._confidence_band(0.97).tier == "very_strong"
159
  assert svc._confidence_band(0.02).tier == "very_strong"
160
  assert svc._confidence_band(0.431577).margin == 0.0
161
+
162
+
163
+ def test_progress_reports_how_far_a_running_step_is() -> None:
164
+ progress = Progress(FILE_STEPS)
165
+ progress.set("timeline", STEP_RUNNING)
166
+ progress.advance("timeline", 3, 12)
167
+ item = next(s for s in progress.snapshot() if s["id"] == "timeline")
168
+ assert item["progress"] == 0.25
169
+
170
+ progress.set("timeline", STEP_DONE)
171
+ item = next(s for s in progress.snapshot() if s["id"] == "timeline")
172
+ assert "progress" not in item