test_prompts.py 775 B

123456789101112131415161718192021
  1. """Tests des textes envoyés à Claude et aux membres. Lancer depuis la racine du projet : python -m unittest"""
  2. import unittest
  3. from bot.claude_client import MEMBER_MEMORY_NOTE
  4. from bot.discord_bot import WELCOME
  5. class PromptsTest(unittest.TestCase):
  6. def test_memory_note_formats(self):
  7. # Une accolade de trop ou un champ oublié ferait planter chaque message avec MEMORY=on.
  8. note = MEMBER_MEMORY_NOTE.format(member_limit=3000, server_limit=5000, max_nicknames=5, max_nickname_length=32)
  9. self.assertNotIn("{", note)
  10. self.assertIn("ne récite jamais la fiche", note)
  11. def test_welcome_formats(self):
  12. self.assertIn("jamais récitée aux autres", WELCOME.format(name="Rika"))
  13. if __name__ == "__main__":
  14. unittest.main()