Skip to content

Commit

Permalink
chore: update pinecone test mock
Browse files Browse the repository at this point in the history
  • Loading branch information
FacerAin committed Dec 6, 2023
1 parent 665ef94 commit 6925fc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pinecone
import pytest
from fastapi.testclient import TestClient

Expand Down Expand Up @@ -25,6 +26,8 @@ def mockreturn(a, b):
return "Hello"

monkeypatch.setattr(PineconeRetriever, "get_relevant_doc_string", mockreturn)
monkeypatch.setattr(pinecone, "init", mockreturn)

response = client.get("/api/v1/chat/similarity-search?query=Hi")
assert response.status_code == 200
assert isinstance(response.text, str)
Expand Down

0 comments on commit 6925fc5

Please sign in to comment.