HDF writeing is correctly tested
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
HDF5 "test.hdf5" {
|
||||||
|
DATASET "/name/adc_data" {
|
||||||
|
DATATYPE H5T_STD_I16LE
|
||||||
|
DATASPACE SIMPLE { ( 2, 2 ) / ( 2, 2 ) }
|
||||||
|
DATA {
|
||||||
|
(0,0): 10, 15,
|
||||||
|
(1,0): 20, 25
|
||||||
|
}
|
||||||
|
ATTRIBUTE "CLASS" {
|
||||||
|
DATATYPE H5T_STRING {
|
||||||
|
STRSIZE 6;
|
||||||
|
STRPAD H5T_STR_NULLTERM;
|
||||||
|
CSET H5T_CSET_ASCII;
|
||||||
|
CTYPE H5T_C_S1;
|
||||||
|
}
|
||||||
|
DATASPACE SCALAR
|
||||||
|
DATA {
|
||||||
|
(0): "CARRAY"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ATTRIBUTE "TITLE" {
|
||||||
|
DATATYPE H5T_STRING {
|
||||||
|
STRSIZE 8;
|
||||||
|
STRPAD H5T_STR_NULLTERM;
|
||||||
|
CSET H5T_CSET_ASCII;
|
||||||
|
CTYPE H5T_C_S1;
|
||||||
|
}
|
||||||
|
DATASPACE SCALAR
|
||||||
|
DATA {
|
||||||
|
(0): "adc data"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ATTRIBUTE "VERSION" {
|
||||||
|
DATATYPE H5T_STRING {
|
||||||
|
STRSIZE 3;
|
||||||
|
STRPAD H5T_STR_NULLTERM;
|
||||||
|
CSET H5T_CSET_ASCII;
|
||||||
|
CTYPE H5T_C_S1;
|
||||||
|
}
|
||||||
|
DATASPACE SCALAR
|
||||||
|
DATA {
|
||||||
|
(0): "1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -144,7 +144,7 @@ class TestADCResult(unittest.TestCase):
|
|||||||
# read back data with h5dump utility (apt-get -y install hdf5-tools)
|
# read back data with h5dump utility (apt-get -y install hdf5-tools)
|
||||||
h5dump = subprocess.run(["h5dump", "-d", "/name/adc_data", "test.hdf5"], capture_output=True)
|
h5dump = subprocess.run(["h5dump", "-d", "/name/adc_data", "test.hdf5"], capture_output=True)
|
||||||
content = h5dump.stdout.decode("utf-8")
|
content = h5dump.stdout.decode("utf-8")
|
||||||
with open("h5dump1_adc_data.ascii", "r") as f:
|
with open("tests/h5dump1_adc_data.ascii", "r") as f:
|
||||||
expected = f.read()
|
expected = f.read()
|
||||||
self.assertEqual(content, expected)
|
self.assertEqual(content, expected)
|
||||||
os.unlink("test.hdf5")
|
os.unlink("test.hdf5")
|
||||||
|
|||||||
Reference in New Issue
Block a user