Skip to content

Commit 82b44f0

Browse files
committed
fix(tests): adapter test_llm_long_text_payload au wrap <TRANSCRIPT>
Le commit 5db4044 (défense prompt-injection LLM) wrappe le texte dicté avec "<TRANSCRIPT>\n...\n</TRANSCRIPT>" avant envoi à Ollama mais a oublié de mettre à jour ce test qui vérifiait l'égalité stricte avec le texte nu. CI rouge sur master depuis. Le test garde son intention (payload non-tronqué) en assertEqual sur la forme wrappée.
1 parent 4680db9 commit 82b44f0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test-postprocess.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,10 +2808,12 @@ def test_llm_long_text_payload(self):
28082808
{"response": long_text}).encode("utf-8")
28092809
mock_url.return_value = mock_resp
28102810
result = _pp.llm_postprocess(long_text)
2811-
# Check that full text was sent
2811+
# Check that full text was sent (wrapped with <TRANSCRIPT>
2812+
# markers since 5db4044 — prompt-injection defense)
28122813
req = mock_url.call_args[0][0]
28132814
payload = _json.loads(req.data.decode("utf-8"))
2814-
self.assertEqual(payload["prompt"], long_text)
2815+
expected = f"<TRANSCRIPT>\n{long_text}\n</TRANSCRIPT>"
2816+
self.assertEqual(payload["prompt"], expected)
28152817

28162818

28172819
# ══════════════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)