-
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.
* move-end-to-end-test: move index tests into test_index.py move llama_stores/ skip test_query move test_query.py into tests/unit/
- Loading branch information
Showing
7 changed files
with
38 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,19 @@ | ||
import pytest | ||
|
||
from tests.context import extract, index | ||
|
||
|
||
def bootstrap_index(xml_dir): | ||
nodes = extract.seed_nodes(xml_dir) | ||
return index.index_nodes(nodes) | ||
|
||
|
||
@pytest.mark.skip(reason="This test takes a minute to run") | ||
def test_bootstrap_index(): | ||
xml_dir = "./resources/xmls/12-pdfs-from-steve-aug-22/" | ||
vector_index = bootstrap_index(xml_dir) | ||
assert vector_index is not None | ||
|
||
|
||
def persist_index(vector_index): | ||
vector_index.storage_context.persist() |
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,19 @@ | ||
import llama_index as li | ||
import pytest | ||
|
||
|
||
@pytest.mark.skip(reason="This cost money to run") | ||
def test_query(): | ||
storage_context = li.StorageContext.from_defaults( | ||
persist_dir="./tests/unit/llama_stores/12-pdfs-from-steve-aug-22/" | ||
) | ||
vector_index = li.load_index_from_storage(storage_context) | ||
assert vector_index is not None | ||
|
||
# Query | ||
query_engine = vector_index.as_query_engine() | ||
assert query_engine is not None | ||
|
||
# TODO: | ||
# response = query_engine.query("What interaction is investigated?") | ||
# assert response.get_response() |