Skip to content

Commit

Permalink
Delete files before test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattzh72 committed Nov 12, 2024
1 parent 4bf616e commit 6481582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions letta/orm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from letta.orm.base import Base
from letta.orm.file import FileMetadata
from letta.orm.organization import Organization
from letta.orm.source import Source
from letta.orm.tool import Tool
Expand Down
3 changes: 2 additions & 1 deletion tests/test_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import letta.utils as utils
from letta.functions.functions import derive_openai_json_schema, parse_source_code
from letta.orm import Organization, Source, Tool, User
from letta.orm import FileMetadata, Organization, Source, Tool, User
from letta.schemas.agent import CreateAgent
from letta.schemas.embedding_config import EmbeddingConfig
from letta.schemas.file import FileMetadata as PydanticFileMetadata
Expand Down Expand Up @@ -38,6 +38,7 @@
def clear_tables(server: SyncServer):
"""Fixture to clear the organization table before each test."""
with server.organization_manager.session_maker() as session:
session.execute(delete(FileMetadata))
session.execute(delete(Source))
session.execute(delete(Tool)) # Clear all records from the Tool table
session.execute(delete(User)) # Clear all records from the user table
Expand Down

0 comments on commit 6481582

Please sign in to comment.