Skip to content

Commit 8a09987

Browse files
committed
test_can_file_be_downloaded: Add potentially helpful printout.
1 parent 0826296 commit 8a09987

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/rimport/test_can_file_be_downloaded.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,26 @@ def test_existing_file_exists(self):
4343
def test_true_abspath(self):
4444
"""Test that can_file_be_downloaded() is true for an existing file given absolute path"""
4545
file_abspath = Path(os.path.join(DEFAULT_STAGING_ROOT, RELPATH_THAT_DOES_EXIST))
46-
assert rimport.can_file_be_downloaded(
46+
result = rimport.can_file_be_downloaded(
4747
file_abspath,
4848
DEFAULT_STAGING_ROOT,
4949
)
50+
assert result, f"Maybe the server is down? Try again. Result was: {result}"
5051

5152
def test_true_relpath(self):
5253
"""Test that can_file_be_downloaded() is true for an existing file given relative path"""
5354
file_relpath = Path(RELPATH_THAT_DOES_EXIST)
54-
assert rimport.can_file_be_downloaded(
55+
result = rimport.can_file_be_downloaded(
5556
file_relpath,
5657
DEFAULT_STAGING_ROOT,
5758
)
59+
assert result, f"Maybe the server is down? Try again. Result was: {result}"
5860

5961
def test_false_nonexistent(self):
6062
"""Test that can_file_be_downloaded() is false for a nonexistent file"""
6163
file_relpath = Path("weurueridniduafnea/smfnigsroerij/msdif8ernnr.nc")
62-
assert not rimport.can_file_be_downloaded(
64+
result = rimport.can_file_be_downloaded(
6365
file_relpath,
6466
DEFAULT_STAGING_ROOT,
6567
)
68+
assert not result, f"Unexpected result: {result}"

0 commit comments

Comments
 (0)