Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: upload more files #132

Merged
merged 6 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,16 @@ def workspace_name(integration_config: CommonConfig) -> str:

if len(_get_file_names(integration_config=integration_config, workspace_name=workspace_name)) == 0:
ArzelaAscoIi marked this conversation as resolved.
Show resolved Hide resolved
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"),
"meta": (None, json.dumps({"find": "me"}).encode("utf-8")),
},
headers={"Authorization": f"Bearer {integration_config.api_key}"},
)
assert response.status_code == HTTPStatus.CREATED
for i in range(15):
response = httpx.post(
f"{integration_config.api_url}/workspaces/{workspace_name}/files",
files={
"file": (f"example{i}.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

_wait_for_file_to_be_available(integration_config, workspace_name)

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="example", content="text", odata_filter="find eq 'me'"
workspace_name=workspace_name, limit=10, name="example0", content="text", odata_filter="find eq 'me'"
)

assert result.total == 1
Expand Down
Loading