-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import os | ||
import tempfile | ||
|
||
from gdown.download import download | ||
|
||
|
||
def test_download(): | ||
url = "https://raw.githubusercontent.com/wkentaro/gdown/3.1.0/gdown/__init__.py" # NOQA | ||
output = "/tmp/gdown_r" | ||
|
||
# Usage before https://github.com/wkentaro/gdown/pull/32 | ||
assert download(url, output, quiet=False) == output | ||
os.remove(output) | ||
with tempfile.TemporaryDirectory() as d: | ||
file_path = os.path.join(d, "file") | ||
url = "https://raw.githubusercontent.com/wkentaro/gdown/3.1.0/gdown/__init__.py" # NOQA | ||
# Usage before https://github.com/wkentaro/gdown/pull/32 | ||
assert download(url=url, output=file_path, quiet=False) == file_path |