Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArzelaAscoIi committed Nov 6, 2023
1 parent a974de4 commit 87debd3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import json
import os
from http import HTTPStatus
from typing import List
Expand Down Expand Up @@ -120,7 +121,10 @@ def workspace_name(integration_config: CommonConfig) -> str:
with open("tests/data/example.txt", "rb") as example_file_txt:
response = httpx.post(
f"{integration_config.api_url}/workspaces/{workspace_name}/files",
files={"file": ("example.txt", example_file_txt, "text/plain")},
files={
"file": ("example.txt", example_file_txt, "text/plain"),
"meta": (None, json.dumps({"find": "me"}).encode("utf-8")),
},
headers={"Authorization": f"Bearer {integration_config.api_key}"},
)
assert response.status_code == HTTPStatus.CREATED
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api/test_integration_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def test_list_paginated(self, integration_config: CommonConfig, workspace_
async with DeepsetCloudAPI.factory(integration_config) as deepset_cloud_api:
files_api = FilesAPI(deepset_cloud_api)
result = await files_api.list_paginated(
workspace_name=workspace_name, limit=10, name="Seven", content="HBO's", odata_filter="find eq 'me'"
workspace_name=workspace_name, limit=10, name="example", content="text", odata_filter="find eq 'me'"
)

assert result.total == 1
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/api/test_integration_upload_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ async def test_list_upload_session(self, integration_config: CommonConfig, works
async with DeepsetCloudAPI.factory(integration_config) as deepset_cloud_api:
upload_session_client = UploadSessionsAPI(deepset_cloud_api)

await upload_session_client.create(workspace_name=workspace_name)

result: UploadSessionDetailList = await upload_session_client.list(
workspace_name=workspace_name, limit=3, page_number=3
workspace_name=workspace_name, limit=1, page_number=0
)

assert result.total > 0
assert result.has_more is True
assert result.data is not None
assert len(result.data) == 3
assert len(result.data) == 1

0 comments on commit 87debd3

Please sign in to comment.