Skip to content

Commit

Permalink
fix(sdk): file order in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-chupryna committed Nov 14, 2024
1 parent f0b3e4b commit f9c3635
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/tests/test_fs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ def test_get_collection_files_returns_all_files(
assert result
assert len(result) == len(test_files)

expected_files = [
{
expected_files = {
str(Path(_TEST_COLLECTION_KEY) / f"file_{test_file['file_key']}"): {
"file_id": str(
Path(_TEST_COLLECTION_KEY) / f"file_{test_file['file_key']}"
),
Expand All @@ -353,11 +353,13 @@ def test_get_collection_files_returns_all_files(
"tags": {},
}
for test_file in test_files
]
}

result_files = {file.file_id: file for file in result}

for file, expected in zip(result, expected_files):
assert file
assert file.file_id == expected["file_id"]
for file_id, expected in expected_files.items():
assert file_id in result_files, f"File ID {file_id} not found in result files."
file = result_files[file_id]
assert file.key == expected["key"]
assert file.exists == expected["exists"]
assert file.tags == expected["tags"]
Expand Down

0 comments on commit f9c3635

Please sign in to comment.