Skip to content

Commit

Permalink
fix: getting back the test case for pgvector engine!
Browse files Browse the repository at this point in the history
getting it back from main branch but just a couple of renames
  • Loading branch information
amindadgar committed May 20, 2024
1 parent 2533f36 commit 83aa683
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit/test_base_pg_engine.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 83aa683

Please sign in to comment.