mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
fix entity create test
This commit is contained in:
@@ -121,14 +121,14 @@ class MemoryService:
|
||||
except Exception as e:
|
||||
raise DatabaseSyncError(f"Failed to update database index: {str(e)}") from e
|
||||
|
||||
async def create_entity(self, name: str, type: str, context: Optional[str] = None) -> Entity:
|
||||
async def create_entity(self, name: str, type: str, description: Optional[str] = None) -> Entity:
|
||||
"""Create a new entity."""
|
||||
entity_id = self._generate_id(name)
|
||||
entity_data = {
|
||||
"id": entity_id,
|
||||
"name": name,
|
||||
"entity_type": type,
|
||||
"context": context,
|
||||
"description": description,
|
||||
"created_at": datetime.now(UTC)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@ async def test_create_entity_success(memory_service):
|
||||
entity = await memory_service.create_entity(
|
||||
name="Test Entity",
|
||||
type="test",
|
||||
context="test context"
|
||||
description="test description"
|
||||
)
|
||||
|
||||
# Assert
|
||||
assert isinstance(entity, Entity)
|
||||
assert entity.name == "Test Entity"
|
||||
assert entity.entity_type == "test"
|
||||
assert entity.context == "test context"
|
||||
assert entity.description == "test description"
|
||||
|
||||
# Verify file was created
|
||||
entity_file = memory_service.project_path / "entities" / f"{entity.id}.md"
|
||||
|
||||
Reference in New Issue
Block a user