Debian Codegraph @

nxs/test/napi/test_file_creation.py

raw ◀ ▶
1 Debian patch touch this file
1 """@package nxs
2 Python NeXus interface.
3
4 NeXus_ is a common data format for neutron, Xray and muon science.
5 The files contain multidimensional data elements grouped into a
6 hierarchical structure. The data sets are self-describing, with
7 a description of the instrument configuration including the units
8 used as well as the data measured.
9
10 The NeXus file interface requires compiled libraries to read the
11 underlying HDF_ files. Binary packages are available for some
12 platforms from the NeXus site. Details of where the nxs package
13 searches for the libraries are recorded in `nxs.napi`.
14 """
15
16 import unittest
17 import nxs.napi as napi
18 import os
19
20 class test_file_creation(unittest.TestCase):
21
•22 @unittest.skipIf('SKIP_NXS_TESTS_HDF5' in os.environ,
23 "HDF5 tests disabled in environment")
24 def test_hdf5(self):
25 f = napi.open("test_hdf5.nxs","w5")
26 os.remove("test_hdf5.nxs")
27
•28 @unittest.skipIf('SKIP_NXS_TESTS_HDF4' in os.environ,
29 "HDF4 tests disabled in environment")
30 def test_hdf4(self):
31 f = napi.open("test_hdf4.nxs","w4")
32 os.remove("test_hdf4.nxs")
33
•34 @unittest.skipIf('SKIP_NXS_TESTS_MXML' in os.environ,
35 "MXML tests disabled in environment")
36 def test_mxml(self):
37 f = napi.open("test_mxml.nxs","wx")
38