Commit 656a405e authored by payno's avatar payno Committed by Henri Payno
Browse files

[gui][normalization] replace hard coded path to a MockScan

parent 77b58e0c
......@@ -33,26 +33,38 @@ __date__ = "23/06/2021"
from silx.gui.utils.testutils import TestCaseQt
from tomwer.gui.reconstruction.normalization.intensity import NormIntensityWindow
from tomwer.core.scan.hdf5scan import HDF5TomoScan
from tomwer.core.utils.scanutils import MockHDF5
from silx.gui import qt
import tempfile
import shutil
import os
class TestNormIntensityWindow(TestCaseQt):
def setUp(self):
super(TestNormIntensityWindow, self).setUp()
self._widget = NormIntensityWindow(parent=None)
self._tmp_dir = tempfile.mkdtemp()
scan_path = os.path.join(self._tmp_dir, "my_scan_2")
self.scan = MockHDF5(
scan_path=scan_path,
n_ini_proj=10,
n_proj=10,
n_alignement_proj=2,
create_final_ref=False,
create_ini_dark=True,
create_ini_ref=True,
n_refs=1,
).scan
def tearDown(self):
super(TestNormIntensityWindow, self).tearDown()
self._widget.setAttribute(qt.Qt.WA_DeleteOnClose)
self._widget.close()
self._widget = None
shutil.rmtree(self._tmp_dir)
def test(self):
scan = HDF5TomoScan(
scan="/media/payno/0c327c0f-2e67-45eb-b1c3-c7aebe6b41d7/data/dataset_esrf/dxfile/tomo_00068/tomo_00068.nx",
entry="entry0000",
)
self._widget.setScan(scan)
self._widget.setScan(self.scan)
self._widget.show()
self.qapp.exec()
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