def test_register_plugin_no_prepend(self):
        # GIVEN a version of h5py that has the h5pl module
        with patch('h5py.h5pl', create=True) as mock:

            # WHEN h5py.h5pl doesn't have the prepend method
            del mock.prepend
            # and the hdf5 plugin path variable hasn't been set
            if 'HDF5_PLUGIN_PATH' in os.environ:
                del os.environ['HDF5_PLUGIN_PATH']
            self.assertTrue('HDF5_PLUGIN_PATH' not in os.environ)

            # THEN when we try and register the vbz plugin we fall back to setting
            # HDF5_PLUGIN_PATH (because we can't use prepend)
            plugin_path = register_plugin()
            self.assertTrue(os.environ['HDF5_PLUGIN_PATH'] == plugin_path)
Пример #2
0
__version__ = '3.1.3'
__version_info__ = tuple([int(num) for num in __version__.split('.')])
CURRENT_FAST5_VERSION = 2.0

# Set up a default NullHandler in case we don't end up using another one
# Taken from http://docs.python-guide.org/en/latest/writing/logging/
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())

from ont_fast5_api.compression_settings import register_plugin
register_plugin()