Skip to content

Commit 88be2e9

Browse files
Adrian Damianbsipocz
authored andcommitted
Bumped coverage
1 parent 883bd60 commit 88be2e9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

astroquery/alma/tests/test_alma.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def _requests_mock(method, url, **kwargs):
417417
response = Mock()
418418
response.headers = {
419419
'Content-Disposition': 'attachment; '
420-
'filename="{}"'.format(url.split('/')[-1])}
420+
'filename={}'.format(url.split('/')[-1])}
421421
return response
422422

423423
def _download_file_mock(url, file_name, **kwargs):
@@ -427,3 +427,17 @@ def _download_file_mock(url, file_name, **kwargs):
427427
alma._download_file = Mock(side_effect=_download_file_mock)
428428
downloaded_files = alma.download_files(['https://location/file1'])
429429
assert len(downloaded_files) == 1
430+
assert downloaded_files[0].split('/')[-1] == 'file1'
431+
432+
alma._request.reset_mock()
433+
alma._download_file.reset_mock()
434+
downloaded_files = alma.download_files(['https://location/file1',
435+
'https://location/file2'])
436+
assert len(downloaded_files) == 2
437+
438+
# error cases
439+
alma._request = Mock()
440+
# no Content-Disposition results in no downloaded file
441+
alma._request.return_value = Mock(headers={})
442+
result = alma.download_files(['https://location/file1'])
443+
assert not result

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ astropy_header = true
3232
text_file_format = rst
3333
xfail_strict = true
3434
remote_data_strict = true
35-
addopts = --doctest-rst
35+
#addopts = --doctest-rst
3636
filterwarnings =
3737
error
3838
ignore: Experimental:UserWarning:

0 commit comments

Comments
 (0)