File size: 1,999 Bytes
096c926 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2019 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
import pytest
import h5py
from h5py import h5pl
from h5py.tests.common import insubprocess, subproc_env
# pytestmark is a special name - the skipif marker applies to the whole file
pytestmark = pytest.mark.skipif(
h5py.version.hdf5_version_tuple < (1, 10, 1), reason='HDF5 1.10.1+ required'
)
@pytest.mark.mpi_skip
@insubprocess
@subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
def test_default(request):
assert h5pl.size() == 1
assert h5pl.get(0) == b'h5py_plugin_test'
@pytest.mark.mpi_skip
@insubprocess
@subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
def test_append(request):
h5pl.append(b'/opt/hdf5/vendor-plugin')
assert h5pl.size() == 2
assert h5pl.get(0) == b'h5py_plugin_test'
assert h5pl.get(1) == b'/opt/hdf5/vendor-plugin'
@pytest.mark.mpi_skip
@insubprocess
@subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
def test_prepend(request):
h5pl.prepend(b'/opt/hdf5/vendor-plugin')
assert h5pl.size() == 2
assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
assert h5pl.get(1) == b'h5py_plugin_test'
@pytest.mark.mpi_skip
@insubprocess
@subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
def test_insert(request):
h5pl.insert(b'/opt/hdf5/vendor-plugin', 0)
assert h5pl.size() == 2
assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
assert h5pl.get(1) == b'h5py_plugin_test'
@pytest.mark.mpi_skip
@insubprocess
@subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
def test_replace(request):
h5pl.replace(b'/opt/hdf5/vendor-plugin', 0)
assert h5pl.size() == 1
assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
@pytest.mark.mpi_skip
@insubprocess
def test_remove(request):
h5pl.remove(0)
assert h5pl.size() == 0
|