Skip to content
Snippets Groups Projects
Commit ac8db937 authored by jamescalam's avatar jamescalam
Browse files

fix: tfidf tests

parent f9a72dbf
Branches
Tags
No related merge requests found
...@@ -37,7 +37,7 @@ class TestTfidfEncoder: ...@@ -37,7 +37,7 @@ class TestTfidfEncoder:
result = tfidf_encoder(["test"]) result = tfidf_encoder(["test"])
assert isinstance(result, list), "Result should be a list" assert isinstance(result, list), "Result should be a list"
assert all( assert all(
isinstance(sublist, list) for sublist in result isinstance(sparse_emb.embedding, np.ndarray) for sparse_emb in result
), "Each item in result should be a list" ), "Each item in result should be a list"
def test_call_method_no_docs_tfidf_encoder(self, tfidf_encoder): def test_call_method_no_docs_tfidf_encoder(self, tfidf_encoder):
...@@ -55,7 +55,7 @@ class TestTfidfEncoder: ...@@ -55,7 +55,7 @@ class TestTfidfEncoder:
result = tfidf_encoder(["doc with fake word gta5jabcxyz"]) result = tfidf_encoder(["doc with fake word gta5jabcxyz"])
assert isinstance(result, list), "Result should be a list" assert isinstance(result, list), "Result should be a list"
assert all( assert all(
isinstance(sublist, list) for sublist in result isinstance(sparse_emb.embedding, np.ndarray) for sparse_emb in result
), "Each item in result should be a list" ), "Each item in result should be a list"
def test_call_method_with_uninitialized_model(self, tfidf_encoder): def test_call_method_with_uninitialized_model(self, tfidf_encoder):
......
...@@ -19,6 +19,7 @@ from platform import python_version ...@@ -19,6 +19,7 @@ from platform import python_version
PINECONE_SLEEP = 6 PINECONE_SLEEP = 6
def mock_encoder_call(utterances): def mock_encoder_call(utterances):
# Define a mapping of utterances to return values # Define a mapping of utterances to return values
mock_responses = { mock_responses = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment