Commit b222eb42 authored by Henri Payno's avatar Henri Payno
Browse files

[acquisition][hdf5] rework base acquistion test

parent 0eb6383a
Pipeline #53963 failed with stages
in 9 minutes and 10 seconds
......@@ -28,8 +28,6 @@ __license__ = "MIT"
__date__ = "12/03/2021"
from nxtomomill.converter.hdf5.acquisition.baseacquisition import BaseAcquisition
import unittest
import shutil
import os
from import DataUrl
from import TomoHDF5Config
......@@ -37,17 +35,11 @@ import tempfile
import h5py
class TestBaseAcquisition(unittest.TestCase):
def test_BaseAquisition():
"""simple test of the BaseAcquisition class"""
def setUp(self) -> None:
self.tmpdir = tempfile.mkdtemp()
def tearDown(self) -> None:
def test_read_entry(self):
file_path = os.path.join(self.tmpdir, "test.h5")
with tempfile.TemporaryDirectory() as folder:
file_path = os.path.join(folder, "test.h5")
with h5py.File(file_path, mode="w") as h5f:
h5f["/data/toto/dataset"] = 12
......@@ -56,4 +48,4 @@ class TestBaseAcquisition(unittest.TestCase):
root_url=url, configuration=TomoHDF5Config(), detector_sel_callback=None
with std_acq.read_entry() as entry:
self.assertTrue("dataset" in entry)
assert "dataset" in entry
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment