From 83aa68338f243d5eea55857567e1b94eabae76df Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Mon, 20 May 2024 12:19:36 +0330 Subject: [PATCH] fix: getting back the test case for pgvector engine! getting it back from main branch but just a couple of renames --- tests/unit/test_base_pg_engine.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/unit/test_base_pg_engine.py diff --git a/tests/unit/test_base_pg_engine.py b/tests/unit/test_base_pg_engine.py new file mode 100644 index 0000000..15c2c7b --- /dev/null +++ b/tests/unit/test_base_pg_engine.py @@ -0,0 +1,24 @@ +from unittest import TestCase + +from utils.query_engine.base_pg_engine import BasePGEngine + + +class TestPGBaseEngine(TestCase): + def test_setup_vector_store_index(self): + """ + Tests that _setup_vector_store_index creates a PGVectorAccess object + and calls its load_index method. + """ + platform_table_name = "test_table" + community_id = "123456" + base_engine = BasePGEngine( + platform_name=platform_table_name, + community_id=community_id, + ) + base_engine = base_engine._setup_vector_store_index( + testing=True, + ) + + expected_dbname = f"community_{community_id}" + self.assertIn(expected_dbname, base_engine.vector_store.connection_string) + self.assertEqual(base_engine.vector_store.table_name, platform_table_name) \ No newline at end of file