Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for Path.fix_win_long_file #7775

Merged
merged 2 commits into from
Dec 13, 2023
Merged

Add tests for Path.fix_win_long_file #7775

merged 2 commits into from
Dec 13, 2023

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Dec 12, 2023

This PR adds tests for Path.fix_win_long_file and contains a small refactoring for DownloadConfig.write that I've done during the investigation of #5926.

- Added import statements for `sys` and `patch`
- Added two new test functions: `test_fix_win_long_file_win()` and `test_fix_win_long_file_linux()`
- Each test function checks if the `fix_win_long_file` function returns the expected result on Windows and Linux respectively
- Refactored the `write` method in `DownloadConfig` class to accept a `filename` parameter of type `Path`.
- Updated the code in `download.py` to pass the correct argument type when calling the `write` method.

This commit improves code readability and ensures proper handling of file paths.
@drew2a drew2a changed the title Fix/5926 Add tests for Path.fix_win_long_file Dec 12, 2023
@drew2a drew2a marked this pull request as ready for review December 12, 2023 15:04
@drew2a drew2a requested review from a team and xoriole and removed request for a team December 12, 2023 15:04
@drew2a drew2a merged commit 822f354 into Tribler:main Dec 13, 2023
31 of 32 checks passed
@drew2a drew2a deleted the fix/5926 branch December 13, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants