def test_toDat(self, tim_data, tim_header): myTim = TimeSeries(tim_data, Header(tim_header)) datfile, inffile = myTim.toDat(basename="temp_test") assert os.path.isfile(datfile) assert os.path.isfile(inffile) os.remove(datfile) os.remove(inffile)
def test_readDat(self, tim_data, tim_header): myTim = TimeSeries(tim_data, Header(tim_header)) datfile, inffile = myTim.toDat(basename="temp_test") mynewTim = TimeSeries.readDat(filename=datfile) assert mynewTim.header.nbits == 32 assert mynewTim.header.source_name == "test" np.testing.assert_allclose(np.mean(mynewTim), 128, atol=0.1) os.remove(datfile) os.remove(inffile)