Phase 3 KPI 계약 상수 분리
This commit is contained in:
parent
d9458d0e40
commit
d18e4b6b4b
7 changed files with 69 additions and 53 deletions
|
|
@ -15,18 +15,7 @@ from app.services.phase3_kpi_export import (
|
|||
write_kpi_report,
|
||||
write_prepost_csv,
|
||||
)
|
||||
|
||||
|
||||
REQUIRED_METRIC_KEYS = {
|
||||
"denominator",
|
||||
"method",
|
||||
"numerator",
|
||||
"pass",
|
||||
"source_files",
|
||||
"status",
|
||||
"threshold",
|
||||
"value",
|
||||
}
|
||||
from app.services.phase3_kpi_contract import KPI_METRIC_REQUIRED_KEYS
|
||||
|
||||
|
||||
def fixture_rows():
|
||||
|
|
@ -134,7 +123,7 @@ class Phase3KpiExportTests(unittest.TestCase):
|
|||
self.assertEqual(report["cohort_size"], 2)
|
||||
self.assertTrue(set(PHASE3_KPI_METRICS).issubset(report["metrics"]))
|
||||
for metric in report["metrics"].values():
|
||||
self.assertTrue(REQUIRED_METRIC_KEYS.issubset(metric))
|
||||
self.assertTrue(KPI_METRIC_REQUIRED_KEYS.issubset(metric))
|
||||
self_efficacy = report["metrics"]["self_efficacy_prepost"]
|
||||
self.assertFalse(self_efficacy["pass"])
|
||||
self.assertEqual(self_efficacy["status"], "computed_prepost")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue