Skip to content

Commit 8a51eff

Browse files
authored
Merge pull request #92 from hydroshare/5793-download-tests
[#5793] fix download tests
2 parents 772c9cd + fde611e commit 8a51eff

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/test-on-demand.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Test on demand
22

33
on:
4-
pull_request:
5-
branches:
6-
- '**'
74
workflow_dispatch:
85
inputs:
96
target:
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python package
4+
name: Run tests and lint
55

66
on:
77
push:
@@ -21,6 +21,9 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v3
24+
with:
25+
ref: ${{ github.head_ref }}
26+
fetch-depth: 0
2427
- name: Set up Python ${{ matrix.python-version }}
2528
uses: actions/setup-python@v3
2629
with:

hsclient/hydroshare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,9 @@ def retrieve_zip(self, path, save_path="", params=None):
14171417
"Failed GET {}, status_code {}, message {}".format(url, response.status_code, response.content)
14181418
)
14191419
filename = path.split("/")[-1]
1420+
# append .zip to the filename if it doesn't end with .zip
1421+
if not filename.endswith(".zip"):
1422+
filename += ".zip"
14201423
downloaded_file = os.path.join(save_path, filename)
14211424
with open(downloaded_file, 'wb') as f:
14221425
f.write(response.content)

0 commit comments

Comments
 (0)