-
Notifications
You must be signed in to change notification settings - Fork 608
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
Implemented check_disk_space function #1590
Implemented check_disk_space function #1590
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @martinbrose thanks again for another PR! Your approach here is good. I focused the review and comments on how the logic could be simplified by having a helper doing only 1 check but being called multiple times. This simplifies the overall logic by reducing the number of if ... is not None:
statements. Let me know what you think about it :)
@Wauplin many thanks for your detailed review comments. I'll attend to them soon. What I realised is that I haven't added any test cases to Would you also want to have these helpers added to |
Good questions!
What I would do is to test the helper individually and not the end-to-end process of downloading a file.
To mock functions, you can use
No need for that! It's a small private helper so it's better to not expose it :) |
Hi @Wauplin, I believe I have addressed all your review points. The only remaining point from my side:
Is this something I need to address? Thank you! |
Oh, actually another question: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @martinbrose !
You mypy issues can be solved quite easily by changing the expected input type.
About the test case when you have exactly the good amount of free space, I don't think it's worth it. TBH on a normal computer there are 0 chances that you'll use exactly the 100% of your hard-drive. And even if that's the case your computer will have other issues since it's always writing/reading the disk. So let's not overthink this :)
Addressed nearly all of the review points. I need to read up on testing for warnings with |
I suspect we don't really have a warning with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work again! Looks good to merge :)
Addressing #1551.
disk_usage
before download #1551