Skip to content
Snippets Groups Projects
Commit 04d2a87c authored by James Briggs's avatar James Briggs
Browse files

fix: better test coverage

parent 1f2b9f0e
No related branches found
No related tags found
No related merge requests found
...@@ -272,6 +272,23 @@ class TestSemanticRouter: ...@@ -272,6 +272,23 @@ class TestSemanticRouter:
assert route_layer.score_threshold == openai_encoder.score_threshold assert route_layer.score_threshold == openai_encoder.score_threshold
if index_cls is PineconeIndex: if index_cls is PineconeIndex:
time.sleep(PINECONE_SLEEP) # allow for index to be updated time.sleep(PINECONE_SLEEP) # allow for index to be updated
_ = route_layer("Hello")
assert len(route_layer.index.get_utterances()) == 6
def test_init_and_add_single_utterance(
self, route_single_utterance, openai_encoder, index_cls
):
index = init_index(index_cls)
route_layer = SemanticRouter(
encoder=openai_encoder,
index=index,
auto_sync="local",
)
if index_cls is PineconeIndex:
time.sleep(PINECONE_SLEEP) # allow for index to be updated
route_layer.add(routes=[route_single_utterance])
assert route_layer.score_threshold == openai_encoder.score_threshold
_ = route_layer("Hello")
assert len(route_layer.index.get_utterances()) == 1 assert len(route_layer.index.get_utterances()) == 1
def test_delete_index(self, openai_encoder, routes, index_cls): def test_delete_index(self, openai_encoder, routes, index_cls):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment