Skip to content

Commit 42a0dfa

Browse files
committed
Add unit tests for dl_database
1 parent 0c15cdc commit 42a0dfa

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_io.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import wfdb
22
import numpy as np
33
import os
4+
import shutil
45

56

67
class test_record():
@@ -391,3 +392,20 @@ def tearDownClass(self):
391392
for file in writefiles:
392393
if os.path.isfile(file):
393394
os.remove(file)
395+
396+
397+
class test_download():
398+
# Test that we can download records with no "dat" file
399+
# Regression test for https://github.com/MIT-LCP/wfdb-python/issues/118
400+
def test_dl_database_no_dat_file():
401+
wfdb.dl_database('afdb', './download-tests/', ['00735'])
402+
403+
# Test that we can download records that *do* have a "dat" file.
404+
def test_dl_database_with_dat_file():
405+
wfdb.dl_database('afdb', './download-tests/', ['04015'])
406+
407+
# Cleanup written files
408+
@classmethod
409+
def tearDownClass(self):
410+
if os.path.isdir('./download-tests/'):
411+
shutil.rmtree('./download-tests/')

0 commit comments

Comments
 (0)