def test_added_plot_record_contains_history(self): processing_step = processing.SingleProcessingStep() self.dataset.process(processing_step) self.dataset.plot(self.plotter) representation = self.dataset.representations[-1] self.assertEqual(len(self.dataset.history), len(representation.plot.preprocessing))
def test_added_plot_record_history_is_deepcopy(self): processing_step = processing.SingleProcessingStep() self.dataset.process(processing_step) self.dataset.plot(self.plotter) representation = self.dataset.representations[-1] self.assertNotEqual(self.dataset.history, representation.plot.preprocessing)
def test_added_analysis_record_contains_history(self): processing_step = processing.SingleProcessingStep() self.dataset.process(processing_step) self.dataset.analyse(self.analysis_step) analysis_ = self.dataset.analyses[-1] self.assertEqual(len(self.dataset.history), len(analysis_.analysis.preprocessing))
def test_added_analysis_record_history_is_deepcopy(self): processing_step = processing.SingleProcessingStep() self.dataset.process(processing_step) self.dataset.analyse(self.analysis_step) analysis_ = self.dataset.analyses[-1] self.assertNotEqual(self.dataset.history, analysis_.analysis.preprocessing)
def test_from_dict_sets_tasks(self): processing_step = processing.SingleProcessingStep() self.dataset.process(processing_step) dataset_dict = self.dataset.to_dict() new_dataset = dataset.Dataset() new_dataset.from_dict(dataset_dict) self.assertDictEqual(self.dataset.tasks[0]["task"].to_dict(), new_dataset.tasks[0]["task"].to_dict())
def setUp(self): self.dataset = dataset.Dataset() self.processing_step = processing.SingleProcessingStep()
def test_not_undoable_processing_step_empties_representations(self): processing_step = processing.SingleProcessingStep() processing_step.undoable = False self.dataset.process(processing_step) self.assertEqual(self.dataset.representations, [])
def test_not_undoable_processing_step_resets_origdata(self): processing_step = processing.SingleProcessingStep() processing_step.undoable = False old_origdata = self.dataset._origdata self.dataset.process(processing_step) self.assertIsNot(self.dataset._origdata, old_origdata)
def test_undoable_processing_step_does_not_touch_origdata(self): processing_step = processing.SingleProcessingStep() processing_step.undoable = True old_origdata = self.dataset._origdata self.dataset.process(processing_step) self.assertIs(self.dataset._origdata, old_origdata)
def test_process_returns_processing_object(self): processing_object = processing.SingleProcessingStep() processing_step = self.dataset.process(processing_object) self.assertTrue(isinstance(processing_step, processing.SingleProcessingStep))
def setUp(self): self.processing_step = processing.SingleProcessingStep() self.processing_record = \ aspecd.history.ProcessingStepRecord(self.processing_step)