-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #59 add method for cancelling a download request
- Loading branch information
Showing
6 changed files
with
98 additions
and
3 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
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,4 +1,4 @@ | ||
__version__ = "0.5.1" | ||
__version__ = "0.5.2" | ||
__title__ = "pygbif" | ||
__author__ = "Scott Chamberlain" | ||
__license__ = "MIT" |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Tests for occurrences module - download_cancle methods""" | ||
from pygbif import occurrences as occ | ||
import vcr | ||
|
||
@vcr.use_cassette("test/vcr_cassettes/test_download_cancel.yaml", filter_headers=['authorization']) | ||
def test_download_cancel(): | ||
"occurrences.download_cancel - basic test" | ||
name_key = '156780401' # for "Bear picornavirus 1" | ||
res = occ.download('taxonKey = ' + name_key) | ||
download_key = res[0] | ||
out = occ.download_cancel(download_key) | ||
assert True == out |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
interactions: | ||
- request: | ||
body: 'false' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '5' | ||
Content-Type: | ||
- application/json | ||
user-agent: | ||
- python-requests/2.25.1,pygbif/0.5.1 | ||
method: DELETE | ||
uri: http://api.gbif.org/v1/occurrence/download/request/0003970-140910143529206 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Age: | ||
- '0' | ||
Cache-Control: | ||
- no-cache, no-store, max-age=0, must-revalidate | ||
Connection: | ||
- keep-alive | ||
Date: | ||
- Thu, 28 Jan 2021 02:30:43 GMT | ||
Expires: | ||
- '0' | ||
Pragma: | ||
- no-cache | ||
Vary: | ||
- Origin, Access-Control-Request-Method, Access-Control-Request-Headers | ||
Via: | ||
- 1.1 varnish (Varnish/6.0) | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- DENY | ||
X-Varnish: | ||
- '955582058' | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 204 | ||
message: No Content | ||
version: 1 |