Add unit tests for _download_url?
See original GitHub issueCurrently _download_git
, _download_svn
and _download_hg
are all not getting hit by the test suite.
It will probably be useful to add unit tests that hit (via the public interface) those code paths.
I think the easiest way to get a useful version of this working is to mock out os.system
and check that the correct system calls are made.
We can and possibly should also make integration tests that actually make the relevant system calls, but we can defer those later because they have some more dev-ops-y implications.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Write a unit test for downloading a file - Stack Overflow
Write a unit test for downloading a file · 1. You're mocking a HttpServletResponse. Calling getOutputStream() on this mock response will thus return...
Read more >How to unit test code that downloads a file from a github repo
The idea is that I can use the class FileDownloader , inject it with a IStorageProvider , call myFileDownloader.Download(url) , and it will ......
Read more >Unit test downloading a file - DEV Community
Overview. In this article, I am going to show you how to add the functionality of downloading a pdf to an application using...
Read more >Unit Test for - Patch My PC Feature and Application Request
Add - Unit Test for Local Content on package Info. Currently, when you open Package information, if you click on the DownloadURL for...
Read more >Download files with Cloud Storage on Web - Firebase
Download Data via URL. You can get the download URL for a file by calling the getDownloadURL() method on a Cloud Storage reference....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jaraco I think we should do the basic smoke tests (i.e. mock out the system calls), if only so that the CI won’t complain about coverage issues when we make changes like #1499.
Also, when we do “hard” deprecate them, we’ll want tests to make sure the deprecation warnings are raised, and having some existing “mock tests” will make that easier (since we can just inject the “pytest.warns” assertion directly into those tests).
working on this with @vitoace and @serjx86