From 09aa56b63daea00f1ef12142924d6c77a803ca2b Mon Sep 17 00:00:00 2001 From: asoderlind Date: Sun, 15 Oct 2023 10:22:07 +0200 Subject: [PATCH] add test --- tests/test_vector_store.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_vector_store.py diff --git a/tests/test_vector_store.py b/tests/test_vector_store.py new file mode 100644 index 000000000..a4b2d3c73 --- /dev/null +++ b/tests/test_vector_store.py @@ -0,0 +1,16 @@ +import pytest +from flask import Flask +from application.error import bad_request, response_error +from application.vectorstore.faiss import FaissStore +from application.core.settings import settings + +def test_init_local_faiss_store_huggingface(): + """ + Test that asserts that trying to initialize a FaissStore with + the huggingface sentence transformer below together with the + index.faiss file in the application/ folder results in a + dimension mismatch error. + """ + settings.EMBEDDINGS_NAME = "huggingface_sentence-transformers/all-mpnet-base-v2" + with pytest.raises(ValueError): + FaissStore("application/", "", None)