Skip to content

Commit fdf71a3

Browse files
author
Andrei Neagu
committed
fixed tests
1 parent 16b6c92 commit fdf71a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/public-api/test_files_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import osparc
1212
import pytest
13+
from osparc_client.models.file import File
1314

1415

1516
def test_upload_file(files_api: osparc.FilesApi, tmp_path: Path):
@@ -38,6 +39,11 @@ def test_upload_file(files_api: osparc.FilesApi, tmp_path: Path):
3839
# FIXME: assert input_file.checksum == same_file.checksum
3940

4041

42+
def _get_comparison_fields(file: File) -> dict:
43+
data = file.to_dict()
44+
return {x: data[x] for x in ("checksum", "e_tag", "filename")}
45+
46+
4147
@pytest.mark.parametrize("file_type", ["binary", "text"])
4248
def test_upload_list_and_download(
4349
files_api: osparc.FilesApi, tmp_path: Path, file_type: str, faker
@@ -60,7 +66,7 @@ def test_upload_list_and_download(
6066
myfiles = files_api.list_files()
6167
assert myfiles
6268
assert all(isinstance(f, osparc.File) for f in myfiles)
63-
assert input_file in myfiles
69+
assert _get_comparison_fields(input_file) in map(_get_comparison_fields, myfiles)
6470

6571
download_path: str = files_api.download_file(file_id=input_file.id)
6672

0 commit comments

Comments
 (0)