def test_data_handler(kernels): r""" Basic data handler test """ print("\n===== test_data_handler =====") with pytest.raises(IOError): data_handler.DATAHandle(filename='made_up_not_existing_file.h5', kernels=kernels) with pytest.raises(IOError): data_handler.DATAHandle(filename=os.path.abspath(__file__), kernels=kernels) filename_fil = os.path.join(TESTDIR, VOYAFIL) with pytest.raises(IOError): out_dir = os.path.join(tempfile.mkdtemp()) + '/NO/SUCH/DIRECTORY' dh = data_handler.DATAHandle(filename=filename_fil, out_dir=out_dir, n_coarse_chan=42, coarse_chans=None, kernels=kernels) dh = data_handler.DATAHandle(filename=filename_fil, out_dir=os.path.join(tempfile.mkdtemp()), n_coarse_chan=42, coarse_chans=None, kernels=kernels) assert dh.status filename_h5 = os.path.join(TESTDIR, VOYAH5) dh = data_handler.DATAHandle(filename=filename_h5, n_coarse_chan=42, coarse_chans=(8300, 8400), kernels=kernels) assert dh.status
def test_data_handler(): """ Basic data handler test """ print("\n===== test_data_handler =====") with pytest.raises(OSError): # not AttributeError fh = data_handler.DATAHandle(filename='made_up_not_existing_file.h5')
def test_data_handler(): """ Basic data handler test """ from turbo_seti.find_doppler import data_handler with pytest.raises(AttributeError): fh = data_handler.DATAHandle(filename='made_up_not_existing_file.h5')