question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add unit tests for _download_url?

See original GitHub issue

Currently _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:closed
  • Created 5 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pgansslecommented, Oct 25, 2018

@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).

0reactions
kanikas3commented, Oct 27, 2018

working on this with @vitoace and @serjx86

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found