def setUp(self):
        # Attributes that need to be overwritten in subclasses:
        self.study_class = None
        self.study = None
        self.constructor_data = {}

        experim1 = make_sample_experiment(name="Experim1")
        experim2 = make_sample_experiment(name="Experim2")
        experim3 = make_sample_experiment(name="Experim3")
        self.experims = [experim1, experim2, experim3]
Ejemplo n.º 2
0
    def test_product(self):
        study = self.study
        self.assertEqual(study.product.name, BLANK_PRODUCT_NAME)

        # If we add an experiment with a product, the product changes
        experim1 = make_sample_experiment(name="Experim1")
        study.add_experiments(experim1)
        self.assertEqual(study.product, experim1.product)

        # If we add an experiment with no product, the product doesn't change
        experim2 = make_sample_experiment(name="Experim2")
        study.add_experiments(experim2)
        self.assertEqual(study.product, experim2.product)
    def test_product(self):
        study = self.study
        self.assertIs(study.product, None)

        experim1 = make_sample_experiment(name="Experim1")
        study.add_experiments(experim1)
        self.assertIsInstance(study.product, Product)
Ejemplo n.º 4
0
    def setUp(self):
        # Register all views
        BaseModelViewTestCase.setUp(self)

        # This could be the manual creation of an instance of the Resin togit
        # represent.
        experiment = make_sample_experiment()
        self.model = experiment.column.resin
    def setUp(self):
        # This registers all views defined in kromatography/ui/adapters/api.py
        BaseModelViewTestCase.setUp(self)

        experiment = make_sample_experiment()
        self.model = experiment.system.system_type
Ejemplo n.º 6
0
 def setUp(self):
     self.exp = make_sample_experiment()
     self.exp2 = make_sample_experiment2()
    def _get_system_type_flow_range_min(self):
        if self.model.flow_range is not None:
            range_units = self.model.flow_range.units
            flow_range_min = self.model.flow_range[0]
            return UnitScalar(flow_range_min, units=range_units)

    def _get_system_type_flow_range_max(self):
        if self.model.flow_range is not None:
            range_units = self.model.flow_range.units
            flow_range_max = self.model.flow_range[1]
            return UnitScalar(flow_range_max, units=range_units)

    def _set_system_type_flow_range_min(self, value):
        self.model.flow_range[0] = value

    def _set_system_type_flow_range_max(self, value):
        self.model.flow_range[1] = value


if __name__ == '__main__':
    from kromatography.model.tests.sample_data_factories import (
        make_sample_experiment)
    from kromatography.ui.api import register_all_data_views

    register_all_data_views()

    experiment = make_sample_experiment()
    model = experiment.system.system_type
    model_view = SystemTypeView(model=model)
    model_view.configure_traits()
 def setUp(self):
     self.experiment = make_sample_experiment(name='Run 1')
 def setUp(self):
     self.model = make_sample_experiment()
     self.klass = Experiment
 def test_add_1_experim(self):
     study = self.study
     experim1 = make_sample_experiment(name="Experim1")
     study.add_experiments(experim1)
     self.assertEqual(study.experiments[0], experim1)