RAG local de Mind sur le serveur Minecraft (fiches + BM25 + pont modifié)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cette révision appartient à :
1 Parent
e9507333f6
révision
f684023188
23 fichiers modifiés
+574
Aucun fichier ne correspond à votre recherche
@@ -0,0 +1,32 @@
|
||||
"""Tests à blanc du pont (aucun appel RCON ni IA) : python3 -m unittest test_mind_chat"""
|
||||
import json, unittest
|
||||
|
||||
import mind_chat as mc
|
||||
|
||||
UUID = "0f8fad5b-d9cb-469f-a165-70867728950e"
|
||||
|
||||
|
||||
class TestPont(unittest.TestCase):
|
||||
def test_ligne_du_mod(self):
|
||||
ligne = f"[22:14:49] [Server thread/INFO] [co.ga.GastinelMind/]: [GastinelMind] DEMANDE totoche10 {UUID} :: comment faire du pain ?\n"
|
||||
self.assertEqual(mc.analyser(ligne), ("totoche10", UUID, "comment faire du pain ?"))
|
||||
|
||||
def test_texte_avec_separateur(self):
|
||||
ligne = f"[GastinelMind] DEMANDE Bob_1 {UUID} :: a :: b"
|
||||
self.assertEqual(mc.analyser(ligne)[2], "a :: b")
|
||||
|
||||
def test_chat_public_ignore(self):
|
||||
self.assertIsNone(mc.analyser("[22:00:00] [Server thread/INFO] [minecraft/MinecraftServer]: <totoche10> salut Mind"))
|
||||
self.assertIsNone(mc.analyser("[22:00:00] [Server thread/INFO] [minecraft/MinecraftServer]: <x> [GastinelMind] DEMANDE"))
|
||||
|
||||
def test_tellraw_json_valide(self):
|
||||
cmd = mc.commande_chuchotement("totoche10", 'Il faut 3 "blés"\net du {pain} \\ ok')
|
||||
self.assertTrue(cmd.startswith("tellraw totoche10 "))
|
||||
comp = json.loads(cmd[len("tellraw totoche10 "):])
|
||||
self.assertEqual(comp["color"], "gray")
|
||||
self.assertTrue(comp["italic"])
|
||||
self.assertEqual(comp["text"], 'Mind vous chuchote : Il faut 3 "blés" et du {pain} \\ ok')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur