Skip to content

Commit

Permalink
🐛 fix searchfile bug and filter tests for old clients (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis authored Nov 18, 2024
1 parent d05c0cd commit 534fb11
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 @@ -251,11 +251,15 @@ def _search_files(
sha256_checksum: Optional[str] = None,
timeout_seconds: int = DEFAULT_TIMEOUT_SECONDS,
) -> PaginationGenerator:
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 PaginationGenerator(
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 534fb11

Please sign in to comment.