def setup_module(module):
# enter test directory
os.chdir('pycoal/tests')
# download spectral library over FTP if necessary
if not os.path.isfile(libraryFilenames[0]) and \
not os.path.isfile(libraryFilenames[1]):
ftp_url = "ftpext.cr.usgs.gov"
ftp_dir = "pub/cr/co/denver/speclab/pub/spectral.library/splib06.library/Convolved.libraries/"
ftp = ftplib.FTP(ftp_url)
ftp.login()
ftp.cwd(ftp_dir)
for f in libraryFilenames:
with open("" + f, "wb") as lib_f:
ftp.retrbinary('RETR %s' % f, lib_f.write)
# tear down test module after running tests
评论列表
文章目录