✨ bypass + correctif

This commit is contained in:
Orionis committed 2026-11-16 22:43:11 +01:00
1 parent 1cbbf7aa3c
commit 902529a4ea
9 files changed
+59 -7

No files matched your search

+11
View File
@@ -5,6 +5,7 @@ import unittest
import urllib.error
import urllib.request
from http.server import ThreadingHTTPServer
from unittest import mock
from scalper.server import Handler
@@ -63,6 +64,16 @@ class TestServer(unittest.TestCase):
status, body = self._post("/run", {"source": "demo"})
self.assertEqual(status, 400)
def test_run_force_bypasses_qa_gate(self):
fake = {"score": 10, "pass": False, "issues": [{"type": "x", "critical": True}]}
with tempfile.TemporaryDirectory() as tmp:
with mock.patch("scalper.pipeline.qa_chapter", return_value=fake):
status, body = self._post("/run", {"source": "demo", "series": "demo-1", "lang": "fr", "mock_llm": True, "out": tmp, "max_chapters": 1, "force": True})
self.assertEqual(status, 200)
self.assertEqual(body["status"], "done")
self.assertEqual(body["chapters"][0]["status"], "ok")
self.assertTrue(body["chapters"][0].get("forced"))
if __name__ == "__main__":
unittest.main()