Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjanjua committed May 15, 2024
1 parent 3aa076c commit 800bc4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions tests/unit/api/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,7 @@ async def test_direct_upload_file(self, files_api: FilesAPI, mocked_deepset_clou
mocked_deepset_cloud_api.post.assert_called_once_with(
"test_workspace",
"files",
data={"text": "some text", "meta": json.dumps({"key": "value"})},
params={
"write_mode": "OVERWRITE",
"file_name": "basic.txt",
},
files={"file": ("basic.txt", b"some text")},
data={"meta": json.dumps({"key": "value"})},
params={"write_mode": "OVERWRITE"},
)
2 changes: 1 addition & 1 deletion tests/unit/service/test_files_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ async def test_upload_in_memory_via_sync_upload(

assert not mocked_upload_sessions_api.create.called, "We should not have created a session for a single file"

mocked_files_api.direct_upload_text.assert_called_once_with(
mocked_files_api.direct_upload_in_memory.assert_called_once_with(
workspace_name="test_workspace",
text="test content",
meta={"test": "test"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def test_upload_with_timeout(self, monkeypatch: MonkeyPatch) -> None:

async def test_upload_texts(self, monkeypatch: MonkeyPatch) -> None:
mocked_upload_texts = AsyncMock(return_value=None)
monkeypatch.setattr(FilesService, "upload_texts", mocked_upload_texts)
monkeypatch.setattr(FilesService, "upload_in_memory", mocked_upload_texts)
files = [
DeepsetCloudFile(
name="test_file.txt",
Expand Down

0 comments on commit 800bc4b

Please sign in to comment.