Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

1dc541ec-efa5-4972-8adc-7b7345eb213d 1.8 KB
Raw

You have to be logged in to leave a comment. Sign In
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
  1. # This file is part of h5py, a Python interface to the HDF5 library.
  2. #
  3. # http://www.h5py.org
  4. #
  5. # Copyright 2008-2019 Andrew Collette and contributors
  6. #
  7. # License: Standard 3-clause BSD; see "license.txt" for full license terms
  8. # and contributor agreement.
  9. import pytest
  10. from h5py import h5pl
  11. from h5py.tests.common import insubprocess, subproc_env
  12. @pytest.mark.mpi_skip
  13. @insubprocess
  14. @subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
  15. def test_default(request):
  16. assert h5pl.size() == 1
  17. assert h5pl.get(0) == b'h5py_plugin_test'
  18. @pytest.mark.mpi_skip
  19. @insubprocess
  20. @subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
  21. def test_append(request):
  22. h5pl.append(b'/opt/hdf5/vendor-plugin')
  23. assert h5pl.size() == 2
  24. assert h5pl.get(0) == b'h5py_plugin_test'
  25. assert h5pl.get(1) == b'/opt/hdf5/vendor-plugin'
  26. @pytest.mark.mpi_skip
  27. @insubprocess
  28. @subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
  29. def test_prepend(request):
  30. h5pl.prepend(b'/opt/hdf5/vendor-plugin')
  31. assert h5pl.size() == 2
  32. assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
  33. assert h5pl.get(1) == b'h5py_plugin_test'
  34. @pytest.mark.mpi_skip
  35. @insubprocess
  36. @subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
  37. def test_insert(request):
  38. h5pl.insert(b'/opt/hdf5/vendor-plugin', 0)
  39. assert h5pl.size() == 2
  40. assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
  41. assert h5pl.get(1) == b'h5py_plugin_test'
  42. @pytest.mark.mpi_skip
  43. @insubprocess
  44. @subproc_env({'HDF5_PLUGIN_PATH': 'h5py_plugin_test'})
  45. def test_replace(request):
  46. h5pl.replace(b'/opt/hdf5/vendor-plugin', 0)
  47. assert h5pl.size() == 1
  48. assert h5pl.get(0) == b'/opt/hdf5/vendor-plugin'
  49. @pytest.mark.mpi_skip
  50. @insubprocess
  51. def test_remove(request):
  52. h5pl.remove(0)
  53. assert h5pl.size() == 0
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...