fix: accept default /tmp/chroma path in ChromaDbConfig validator (#4179)

This commit is contained in:
Br1an
2026-03-23 14:12:49 +05:30
committed by GitHub
parent 7cebaba0a2
commit cc45561abd
2 changed files with 15 additions and 2 deletions
+13
View File
@@ -3,6 +3,7 @@ from unittest.mock import Mock, patch
import pytest
from mem0.vector_stores.chroma import ChromaDB
from mem0.configs.vector_stores.chroma import ChromaDbConfig
@pytest.fixture
@@ -249,3 +250,15 @@ def test_generate_where_clause_non_string_values():
# ChromaDB accepts non-string values in filters
expected = {"$and": [{"user_id": {"$eq": "alice"}}, {"count": {"$eq": 5}}, {"active": {"$eq": True}}]}
assert result == expected
def test_chroma_config_accepts_default_tmp_path():
"""Test that ChromaDbConfig accepts the default /tmp/chroma path."""
config = ChromaDbConfig(path="/tmp/chroma")
assert config.path == "/tmp/chroma"
def test_chroma_config_rejects_no_config():
"""Test that ChromaDbConfig rejects when no connection config is provided."""
with pytest.raises(ValueError):
ChromaDbConfig()