mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Combined h5_key tests in hdf5.py
This commit is contained in:
@@ -24,17 +24,7 @@ def assert_has_h5_attribute(output_bytes, key, value):
|
||||
|
||||
|
||||
def assert_has_h5_keys(output_bytes, keys):
|
||||
""" Asserts the specified HDF5 output has exactly the given keys."""
|
||||
_assert_h5py()
|
||||
keys = [k.strip() for k in keys.strip().split(',')]
|
||||
h5_keys = sorted(keys)
|
||||
output_temp = io.BytesIO(output_bytes)
|
||||
local_keys = sorted(list(h5py.File(output_temp, 'r').keys()))
|
||||
assert local_keys == h5_keys, "Not a HDF5 file or H5 keys do not match:\n\t%s\n\t%s" % (local_keys, h5_keys)
|
||||
|
||||
|
||||
def assert_contains_h5_keys(output_bytes, keys):
|
||||
""" Asserts the specified HDF5 output contains the given keys, including recursive group paths."""
|
||||
""" Asserts the specified HDF5 output has the given keys."""
|
||||
_assert_h5py()
|
||||
keys = [k.strip() for k in keys.strip().split(',')]
|
||||
h5_keys = sorted(keys)
|
||||
|
||||
Reference in New Issue
Block a user