import pytest
from app.core.vector_store.embedder.factory import get_embedder_from_config

def test_get_mock_embedder():
    embedder = get_embedder_from_config("mock", 768, None, None)
    assert embedder is not None
    assert embedder.dimension == 768

def test_get_genai_embedder():
    embedder = get_embedder_from_config(
        "google_gemini", 768, "gemini-embedding-001", "fake_key"
    )
    assert embedder.model_name == "gemini-embedding-001"
    assert embedder.api_key == "fake_key"
    assert embedder.dimension == 768

def test_get_embedder_raises_for_invalid_provider():
    with pytest.raises(ValueError):
        get_embedder_from_config("invalid", 768, None, None)
