Files
MonicaAgentIA/test_lubricant_preferences.py
T
2026-09-03 15:34:28 -03:00

107 lines
4.1 KiB
Python
Executable File

import asyncio
import sys
import os
sys.path.insert(0, "/home/marco/MonicaAgentIA/app")
os.environ["TELEGRAM_BOT_TOKEN"] = "test"
os.environ["TELEGRAM_CHAT_ID"] = "123"
from monica_agent import (
build_system_prompt,
load_user_profile,
save_user_profile,
get_agent_profile_summary,
clear_all_data,
)
async def test_lubricant_preferences_in_prompt():
print("=== Verificando preferências de lubrificante no prompt ===")
original_profile = load_user_profile()
profile = load_user_profile()
profile["monica_lubricant_preferences"] = [
"Sempre deve ser utilizado lubrificante nas ações de sexo necessárias. É uma regra obrigatória em todas as penetrações, punhetas, sexo anal, vaginal e qualquer outro tipo de atrito sexual que necessite de lubrificação. Nunca faça sexo seco ou sem lubrificante quando houver penetração ou atrito intenso."
]
save_user_profile(profile)
try:
prompt = build_system_prompt(load_user_profile())
if "Preferências de lubrificante da Mônica" in prompt:
print(" ✅ Preferências de lubrificante estão no prompt do sistema")
else:
print(" ❌ Preferências de lubrificante NÃO estão no prompt")
if "lubrificante" in prompt.lower():
print(" ✅ Conteúdo de lubrificante está no prompt")
else:
print(" ❌ Conteúdo de lubrificante NÃO está no prompt")
if "sexo seco" in prompt.lower() or "sem lubrificante" in prompt.lower():
print(" ✅ Regra de lubrificante obrigatório está no prompt")
else:
print(" ❌ Regra de lubrificante obrigatório NÃO está no prompt")
print(f"\nSystem prompt length: {len(prompt)} chars")
finally:
save_user_profile(original_profile)
async def test_lubricant_preferences_in_summary():
print("\n=== Verificando preferências de lubrificante no sumário ===")
original_profile = load_user_profile()
profile = load_user_profile()
profile["monica_lubricant_preferences"] = [
"Sempre deve ser utilizado lubrificante nas ações de sexo necessárias."
]
save_user_profile(profile)
try:
summary = get_agent_profile_summary(load_user_profile())
if "Preferências de lubrificante" in summary:
print(" ✅ Sumário do agente inclui preferências de lubrificante")
else:
print(" ❌ Sumário do agente NÃO inclui preferências de lubrificante")
if "lubrificante" in summary.lower():
print(" ✅ Detalhe do lubrificante está no sumário")
else:
print(" ❌ Detalhe do lubrificante NÃO está no sumário")
finally:
save_user_profile(original_profile)
async def test_clear_all_data_removes_lubricant_preferences():
print("\n=== Verificando que limpar dados remove preferências de lubrificante ===")
profile = load_user_profile()
profile["monica_lubricant_preferences"] = ["item de teste"]
save_user_profile(profile)
clear_all_data()
profile = load_user_profile()
if not profile.get("monica_lubricant_preferences"):
print(" ✅ clear_all_data removeu preferências de lubrificante")
else:
print(f" ❌ clear_all_data NÃO removeu preferências de lubrificante: {profile.get('monica_lubricant_preferences')}")
async def test_lubricant_preferences_with_empty_profile():
print("\n=== Verificando prompt com perfil vazio ===")
prompt = build_system_prompt({})
if "Preferências de lubrificante da Mônica" not in prompt:
print(" ✅ Prompt vazio NÃO contém preferências de lubrificante (correto)")
else:
print(" ❌ Prompt vazio contém preferências de lubrificante (erro)")
async def main():
await test_lubricant_preferences_in_prompt()
await test_lubricant_preferences_in_summary()
await test_clear_all_data_removes_lubricant_preferences()
await test_lubricant_preferences_with_empty_profile()
print("\n=== Todos os testes de lubrificante concluídos ===")
if __name__ == "__main__":
asyncio.run(main())