Skip to content

Commit

Permalink
merge master into 219-iterator-and-concurrent-file-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis committed Nov 18, 2024
2 parents 243e176 + 534fb11 commit f1426a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions clients/python/src/osparc/_api_files_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,15 @@ def _search_files(
sha256_checksum: Optional[str] = None,
timeout_seconds: int = DEFAULT_TIMEOUT_SECONDS,
) -> PaginationIterator:
kwargs = {
"file_id": file_id,
"sha256_checksum": sha256_checksum,
"_request_timeout": timeout_seconds,
}

def _pagination_method():
return super(FilesApi, self).search_files_page(
file_id=file_id,
sha256_checksum=sha256_checksum,
_request_timeout=timeout_seconds,
**{k: v for k, v in kwargs.items() if v is not None}
)

return PaginationIterator(
Expand Down
7 changes: 4 additions & 3 deletions clients/python/test/e2e/test_files_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ def max_diff(data: List[int]) -> int:
assert _hash_file(Path(downloaded_file)) == _hash_file(large_server_file.local_file)


@skip_if_osparc_version(at_least=Version("0.8.0"))
@pytest.mark.parametrize("use_checksum", [True, False])
@pytest.mark.parametrize("use_id", [True, False])
@skip_if_osparc_version(at_least=Version("0.8.3.post0.dev20"))
@pytest.mark.parametrize(
"use_checksum,use_id", [(True, True), (False, True), (True, False)]
)
def test_search_files(
large_server_file: Callable[[ByteSize], Path],
files_api: osparc.FilesApi,
Expand Down

0 comments on commit f1426a5

Please sign in to comment.