1
0

test_prompts.py 869 B

1234567891011121314151617181920212223
  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. text = WELCOME.format(name="Rika")
  13. self.assertIn("jamais récitée aux autres", text)
  14. self.assertIn("administrateurs du serveur peuvent la voir", text)
  15. if __name__ == "__main__":
  16. unittest.main()