Skip to content

Commit f08d024

Browse files
committed
changes
1 parent 630ae07 commit f08d024

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

package/MDAnalysis/fetch/pdb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def from_DOI(doi, file_name, remove_prefix=True, cache_path=None):
206206
Directory where downloaded file(s) will be cached.
207207
The default ``None`` argument uses the :mod:`pooch` default cache with
208208
project name :data:`DEFAULT_CACHE_NAME_DOWNLOADER`.
209-
209+
210210
211211
Returns
212212
-------
@@ -222,7 +222,7 @@ def from_DOI(doi, file_name, remove_prefix=True, cache_path=None):
222222
223223
:class:`requests.exceptions.HTTPError`
224224
If an invalid file_name is specified.
225-
225+
226226
Notes
227227
-----
228228
The DOI link, as specified by `doi`, should be in the format of
@@ -232,7 +232,7 @@ def from_DOI(doi, file_name, remove_prefix=True, cache_path=None):
232232
233233
The current backend for downloading files is :class:`pooch.DOIDownloader`
234234
which only handles downloading from Zenodo and Figshare repositories.
235-
235+
236236
237237
Examples
238238
--------
@@ -261,7 +261,7 @@ def from_DOI(doi, file_name, remove_prefix=True, cache_path=None):
261261
"""
262262

263263
# Supress warnings from pooch about not specifying
264-
# which version of the repostory to download.
264+
# which version of the repostory to download.
265265
warnings.filterwarnings("ignore", category=UserWarning)
266266

267267
if remove_prefix:

testsuite/MDAnalysisTests/fetch/test_from_DOI.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,24 @@ def test_different_sources(tmp_path, doi, file_name, expected_md5):
108108
assert isinstance(p1, Path)
109109
assert hashlib.md5(p1.read_bytes()).hexdigest() == expected_md5
110110

111+
111112
@pytest.mark.skipif(not HAS_POOCH, reason="Pooch is not installed.")
112113
def test_invalid_doi_link(tmp_path):
113-
114114
with pytest.raises(
115-
HTTPError,
115+
ValueError,
116+
match=re.escape(
117+
"DOI link invalid is invalid. Please check the DOI link."
118+
),
116119
):
120+
117121
from_DOI("invalid", file_name="missing.dat", cache_path=tmp_path)
118122

119-
123+
124+
@pytest.mark.skipif(not HAS_POOCH, reason="Pooch is not installed.")
120125
def test_invalid_file_name(tmp_path):
121126
with pytest.raises(
122-
ValueError,
123-
match=re.escape(
124-
"DOI link doi:invalid is invalid. Please check the DOI link."
125-
),
126-
):
127-
from_DOI("doi.org/invalid", file_name="missing.dat", cache_path=tmp_path)
127+
HTTPError,
128+
):
129+
from_DOI(
130+
"doi.org/invalid", file_name="missing.dat", cache_path=tmp_path
131+
)

0 commit comments

Comments
 (0)