Commit 0a80aba7 authored by payno's avatar payno

[unit test] refactoring create test_stream_operation to separate single...

[unit test] refactoring create test_stream_operation to separate single operation unit test to the steam/pipeline operations
parent 308e3563
......@@ -30,13 +30,11 @@ __date__ = "03/10/2018"
import unittest
from id06workflow.core.experiment.operation import OverwritingOperation, AdditiveOperation, shift
from id06workflow.core.experiment import Experiment, Dataset, POSITIONER_METADATA
from id06workflow.core.utils import metadata as metadatautils
from id06workflow.core.experiment import Experiment
from id06workflow.test import utils
import shutil
import numpy
import tempfile
import os
class TestOperation(unittest.TestCase):
......@@ -123,38 +121,9 @@ class TestShift(unittest.TestCase):
shifted_data[1, 1:, :-1]))
class TestOperationStream(unittest.TestCase):
"""Test some default operation streaming"""
def setUp(self):
unittest.TestCase.setUp(self)
root_folder = '/nobackup/linazimov/payno/datasets/id06/strain_scan'
data_file_pattern = os.path.join(root_folder, 'reduced_strain/strain_0000.edf')
data_bb_files = []
bb_folder = os.path.join(root_folder, 'bg_ff_5s_1x1')
for _file in os.listdir(bb_folder):
data_bb_files.append(os.path.join(bb_folder, _file))
self.dataset = Dataset(data_files_pattern=data_file_pattern,
ff_files=data_bb_files)
self.experiment = Experiment(dataset=self.dataset, geometry=None)
def applyGeometry(self):
"""Apply some geometry"""
pass
def testGeomtry(self):
"""Make sure geometry is well applied"""
self.assertTrue(len(metadatautils.getUnique(self.experiment,
kind=POSITIONER_METADATA,
key='diffry')) is 30)
self.assertTrue(len(metadatautils.getUnique(self.experiment,
kind=POSITIONER_METADATA,
key='obpitch')) is 4)
def suite():
test_suite = unittest.TestSuite()
for ui in (TestOperation, TestCOM, TestShift, TestOperationStream):
for ui in (TestOperation, TestCOM, TestShift):
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
return test_suite
......
......@@ -184,3 +184,12 @@ class TwoThetaGeometryWidget(TwoThetaGeometry, qt.QWidget):
index = self._orientationCB.findText(orientation)
assert index >= 0
self._orientationCB.setCurrentIndex(index)
class DimensionMapping(qt.QWidget):
"""
Widget used to define the number of dimension and with which values they are
mapped
"""
def __init__(self, parent):
pass
Markdown is supported
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