Commit 2307c4c
fix(tests): make zip-download assertions order-tolerant (#429)
Nextcloud server PR nextcloud/server#60225 dropped the implicit `ORDER
BY name ASC` from `Cache::getFolderContentsById`, so the order of
children inside a downloaded zip is now whatever the DB returns and
varies by backend.
On PostgreSQL this breaks test_download_as_zip /
test_download_as_zip_async, which asserted on positional indices.
Rebuild `_test_download_as_zip` around a `{filename: size}` dict and
check membership + sizes instead of positions.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved robustness of ZIP download tests to handle varying file
ordering, ensuring reliable validation of downloaded archive contents.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/cloud-py-api/nc_py_api/pull/429?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Review <review@local>1 parent 01ce7b0 commit 2307c4c
1 file changed
Lines changed: 27 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
879 | 884 | | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
890 | 902 | | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
897 | 907 | | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
| 908 | + | |
902 | 909 | | |
903 | 910 | | |
904 | 911 | | |
| |||
0 commit comments