Spaces:
Runtime error
Runtime error
File size: 1,656 Bytes
8f1de15 6484681 8f1de15 6484681 8f1de15 d150cbb 8f1de15 d150cbb 8f1de15 d150cbb 8f1de15 d150cbb 8f1de15 4e19d62 8f1de15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/usr/bin/env python3
"""
Quick test of memory editor functions
"""
import sys
import os
sys.path.append('.')
# Test the memory editor functions
from coachable_course_agent.memory_store import (
format_memory_editor_display,
update_goal_dialog,
save_updated_goal,
remove_skill,
clear_feedback_log
)
def test_memory_editor():
# Test with a mock user (assuming test_user.json exists)
user_id = "test_user"
print("=== Testing Memory Editor Functions ===")
# Test 1: Load user memory
print("\n1. Loading user memory:")
memory_display = format_memory_editor_display(user_id)
print(memory_display)
# Test 2: Update goal dialog
print("\n2. Current goal for editing:")
current_goal = update_goal_dialog(user_id)
print(f"'{current_goal}'")
# Test 3: Save updated goal
print("\n3. Updating goal:")
status = save_updated_goal(user_id, "Updated goal from memory editor test")
print(f"Status: {status}")
# Test 4: Remove skill (if any skills exist)
print("\n4. Attempting to remove a skill:")
status, updated_memory, cleared_input = remove_skill(user_id, "JavaScript Framework")
print(f"Status: {status}")
print(f"Cleared input: '{cleared_input}'")
print(f"Updated memory preview: {updated_memory[:100]}...")
# Test 5: Clear feedback log
print("\n5. Clearing feedback log:")
status, updated_memory = clear_feedback_log(user_id)
print(f"Status: {status}")
print(f"Updated memory preview: {updated_memory[:100]}...")
print("\n=== Test Complete! ===")
if __name__ == "__main__":
test_memory_editor()
|