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

feat: get pipeline files #177

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
tests: sync workflow files
  • Loading branch information
ArzelaAscoIi committed Apr 14, 2024
commit d34fd1e0dd971037f58994ff217072ca80a5fbd7
27 changes: 27 additions & 0 deletions tests/unit/workflows/sync_client/test_sync_workflow_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from deepset_cloud_sdk.models import UserInfo
from deepset_cloud_sdk.workflows.sync_client.files import (
download,
download_pipeline_files,
get_upload_session,
list_files,
list_upload_sessions,
Expand Down Expand Up @@ -151,6 +152,32 @@ def test_download_files() -> None:
)


def test_download_pipeline_files() -> None:
mocked_async_download_pipeline_files = AsyncMock()
with patch(
"deepset_cloud_sdk.workflows.sync_client.files.async_download_pipeline_files",
new=mocked_async_download_pipeline_files,
):
download_pipeline_files(
workspace_name="my_workspace",
pipeline_name="my_pipeline",
file_dir="./mypath",
batch_size=100,
timeout_s=100,
)
mocked_async_download_pipeline_files.assert_called_once_with(
api_key=None,
api_url=None,
workspace_name="my_workspace",
pipeline_name="my_pipeline",
file_dir="./mypath",
include_meta=True,
batch_size=100,
show_progress=True,
timeout_s=100,
)


def test_list_upload_sessions() -> None:
async def mocked_async_upload_sessions(
*args: Any, **kwargs: Any
Expand Down