We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1b8358 commit 67882dcCopy full SHA for 67882dc
tests/test_knowledgebase.py
@@ -32,10 +32,18 @@ async def test_knowledgebase():
32
33
34
@pytest.mark.asyncio
35
-async def test_viking_knowledgebase_add_texts():
+async def test_viking_knowledgebase_add_texts(monkeypatch):
36
app_name = "kb_test_app"
37
kb = KnowledgeBase(
38
backend="viking",
39
app_name=app_name,
40
)
41
- assert kb.add_from_text(text="test text", tag="tag") is True
+
42
+ # Mock the add_from_text method of the backend
43
+ async def mock_tos_upload(*args, **kwargs):
44
+ return True
45
46
+ monkeypatch.setattr(kb._backend._tos_client, "upload", mock_tos_upload)
47
48
+ result = kb.add_from_text(text="test text", tag="tag")
49
+ assert result is True
0 commit comments