-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: getting back the test case for pgvector engine!
getting it back from main branch but just a couple of renames
- Loading branch information
1 parent
2533f36
commit 83aa683
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |