def setUp(self):
        # Register all views
        BaseModelViewTestCase.setUp(self)

        # This could be the manual creation of an instance of the ChromData to
        # represent.
        self.model = make_sample_simulation_group()
 def test_sim_in_sim_group_plot_request(self):
     study = self.study2
     sim = build_sim_from_study(study)
     group = make_sample_simulation_group(cp=sim)
     study.analysis_tools.simulation_grids.append(group)
     group.initialize_simulations()
     sim2 = group.simulations[0]
     self.assertPlotRequestTriggersCentralPane(study, sim2)
 def test_sim_group_to_itree_node_menu(self):
     model = make_sample_simulation_group()
     analysis_tools = self.study.analysis_tools
     analysis_tools.simulation_grids.append(model)
     tree_node = adapt(model, ITreeNode)
     self.assertIsInstance(tree_node, SimulationGroupToITreeNode)
     expected = {DeleteAction}
     assert_list_element_menu_content_greater(analysis_tools,
                                              "simulation_grids", expected)
    def test_simulation_group_run_request(self):
        task = self.task2
        study = self.study2
        job_manager = task.project.job_manager
        sim = build_sim_from_study(study)
        group = make_sample_simulation_group(cp=sim)
        study.analysis_tools.simulation_grids.append(group)

        with self.assertTraitChanges(job_manager, "_pending_jobs[]", 1):
            group.cadet_request = True
Exemple #5
0
 def test_write_complete_study_with_sim_group(self):
     sim = self.study.simulations[0]
     sim_group = make_sample_simulation_group(cp=sim)
     self.study.analysis_tools.simulation_grids.append(sim_group)
     try:
         # FIXME: SimulationGroup not fully serialized, so it can't be
         # identical => test parts of it:
         save_object(self.test_file, self.study)
         new_obj, _ = load_object(self.test_file)
         self.assertIsInstance(new_obj, Study)
         self.assertEqual(len(new_obj.analysis_tools.simulation_grids), 1)
         self.assertIsInstance(new_obj.analysis_tools.simulation_grids[0],
                               SimulationGroup)
     finally:
         # Clean up for other tests since cls.study is created in setUpClass
         self.study.analysis_tools.simulation_grids.pop(-1)
 def setUp(self):
     self.model = make_sample_simulation_group()
 def setUp(self):
     self.model = make_sample_simulation_group()
     self.klass = SimulationGroup
 def test_create_run_save_load_sim_grid(self):
     object_to_save = make_sample_simulation_group()
     self.run_and_assert_serialization_succeeds(object_to_save)