mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-27 17:56:25 +02:00
refactor: replace hardcoded embedding dimension with dynamic configuration
- Updated the embedding dimension in test configurations to use the value from the application config, enhancing maintainability and consistency across tests.
This commit is contained in:
parent
223c2de0d2
commit
f09b5b0ea4
2 changed files with 6 additions and 2 deletions
|
|
@ -1,9 +1,12 @@
|
|||
import pytest
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.config import config as app_config
|
||||
from app.db import Chunk, Document, DocumentStatus
|
||||
from app.indexing_pipeline.indexing_pipeline_service import IndexingPipelineService
|
||||
|
||||
_EMBEDDING_DIM = app_config.embedding_model_instance.dimension
|
||||
|
||||
pytestmark = pytest.mark.integration
|
||||
|
||||
|
||||
|
|
@ -144,7 +147,7 @@ async def test_embedding_written_to_db(
|
|||
reloaded = result.scalars().first()
|
||||
|
||||
assert reloaded.embedding is not None
|
||||
assert len(reloaded.embedding) == 1024
|
||||
assert len(reloaded.embedding) == _EMBEDDING_DIM
|
||||
|
||||
|
||||
@pytest.mark.usefixtures(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue