Пример #1
0
    def test_dialog_shows_efficiency_files_are_correctly_shown(self, _):
        dialog = DepthProfileDialog(self.parent_widget, self.measurement,
                                    self.global_settings)

        expected = "No efficiency files."

        self.assertEqual(dialog.label_efficiency_files.text(), expected)
        dialog.close()
Пример #2
0
    def test_dialog_shows_correct_cross_section_model(self, _):
        cross_section = CrossSection.LECUYER
        self.global_settings.set_cross_sections(cross_section)
        dialog = DepthProfileDialog(self.parent_widget, self.measurement,
                                    self.global_settings)

        self.assertEqual(dialog.label_cross.text(), str(cross_section))
        dialog.close()
Пример #3
0
    def test_dialog_shows_correct_other_settings(self, _):
        dialog = DepthProfileDialog(self.parent_widget, self.measurement,
                                    self.global_settings)

        self.assertEqual(dialog.check_0line.isChecked(),
                         DepthProfileDialog.line_zero)
        self.assertEqual(dialog.check_scaleline.isChecked(),
                         DepthProfileDialog.line_scale)
        self.assertEqual(dialog.spin_systerr.value(),
                         DepthProfileDialog.systerr)
        dialog.close()
Пример #4
0
 def open_depth_profile(self):
     """Opens depth profile dialog.
     """
     previous = self.depth_profile_widget
     DepthProfileDialog(self, self.obj, self.obj.request.global_settings,
                        statusbar=self.statusbar)
     if self.depth_profile_widget != previous and \
             type(self.depth_profile_widget) is not None:
         # TODO type(x) is not None???
         self.depth_profile_widget.save_to_file()
Пример #5
0
    def test_dialog_shows_correct_measurement_settings(self, _):
        dialog = DepthProfileDialog(self.parent_widget, self.measurement,
                                    self.global_settings)

        self.assertEqual(dialog.label_calibslope.text(),
                         str(self.measurement.detector.tof_slope))
        self.assertEqual(dialog.label_caliboffset.text(),
                         str(self.measurement.detector.tof_offset))
        self.assertEqual(dialog.label_depthstop.text(),
                         str(self.measurement.profile.depth_step_for_stopping))
        self.assertEqual(dialog.label_depthnumber.text(),
                         str(self.measurement.profile.number_of_depth_steps))
        self.assertEqual(dialog.label_depthbin.text(),
                         str(self.measurement.profile.depth_step_for_output))
        self.assertEqual(
            dialog.label_depthscale.text(),
            f"{self.measurement.profile.depth_for_concentration_from} - "
            f"{self.measurement.profile.depth_for_concentration_to}")

        dialog.close()
Пример #6
0
 def test_dialog_is_opened(self, mock_exec):
     dialog = DepthProfileDialog(self.parent_widget, self.measurement,
                                 self.global_settings)
     dialog.close()
     mock_exec.assert_called_once()