|
@@ -6,6 +6,7 @@ from unittest.mock import patch
|
|
from embedchain import App
|
|
from embedchain import App
|
|
from embedchain.config import AppConfig
|
|
from embedchain.config import AppConfig
|
|
from embedchain.vectordb.chroma_db import ChromaDB, chromadb
|
|
from embedchain.vectordb.chroma_db import ChromaDB, chromadb
|
|
|
|
+from chromadb.config import Settings
|
|
|
|
|
|
|
|
|
|
class TestChromaDbHosts(unittest.TestCase):
|
|
class TestChromaDbHosts(unittest.TestCase):
|
|
@@ -19,10 +20,9 @@ class TestChromaDbHosts(unittest.TestCase):
|
|
with patch.object(chromadb, "Client") as mock_client:
|
|
with patch.object(chromadb, "Client") as mock_client:
|
|
_db = ChromaDB(host=host, port=port, embedding_fn=len)
|
|
_db = ChromaDB(host=host, port=port, embedding_fn=len)
|
|
|
|
|
|
- expected_settings = chromadb.config.Settings(
|
|
|
|
- chroma_api_impl="rest",
|
|
|
|
- chroma_server_host=host,
|
|
|
|
- chroma_server_http_port=port,
|
|
|
|
|
|
+ expected_settings = Settings(
|
|
|
|
+ chroma_server_host="test-host",
|
|
|
|
+ chroma_server_http_port="1234",
|
|
)
|
|
)
|
|
|
|
|
|
mock_client.assert_called_once_with(expected_settings)
|
|
mock_client.assert_called_once_with(expected_settings)
|