fix: route medical content strictly local

This commit is contained in:
2026-07-30 19:29:55 +02:00
parent 77b510bd22
commit 9148193806
4 changed files with 50 additions and 6 deletions
+20
View File
@@ -63,6 +63,26 @@ class PrivacyRouterTests(unittest.TestCase):
CloudPolicy.NEVER,
)
def test_medical_questions_are_always_never(self) -> None:
for question in (
"Wenn ich blute, sollte ich dann zum Arzt?",
"Welche Symptome hat eine Grippe?",
"Wie nehme ich dieses Medikament ein?",
"Was bedeutet diese Diagnose?",
"Wie sollte eine Verletzung behandelt werden?",
):
with self.subTest(question=question):
self.assertEqual(
self.router.classify(question).policy,
CloudPolicy.NEVER,
)
def test_technical_terms_cannot_override_medical_never(self) -> None:
decision = self.router.classify(
"Wie speichere ich meine Symptome und Diagnose mit Python in SQLite?"
)
self.assertEqual(decision.policy, CloudPolicy.NEVER)
def test_unknown_content_is_conservatively_ask(self) -> None:
self.assertEqual(
self.router.classify("Erkläre das bitte genauer.").policy,