Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip http query parameters when getting the filename to download
- Loading branch information
Showing
2 changed files
with
17 additions
and
1 deletion.
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,8 +1,24 @@ | ||
from nevermined_sdk_py import ConfigProvider | ||
from nevermined_sdk_py.gateway.gateway import Gateway | ||
from requests import Response | ||
|
||
config = ConfigProvider.get_config() | ||
|
||
|
||
def test_get_rsa_key(): | ||
assert Gateway.get_rsa_public_key(config) | ||
|
||
|
||
def test_get_file_name(): | ||
response = Response() | ||
|
||
response.headers = {"content-disposition": "attachment;filename=test.txt"} | ||
print(response.headers.get("content-disposition")) | ||
file_name = Gateway._get_file_name(response) | ||
assert file_name == "test.txt" | ||
|
||
response.headers = { | ||
"content-disposition": "attachment;filename=test.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256" | ||
} | ||
file_name = Gateway._get_file_name(response) | ||
assert file_name == "test.txt" |