Esempio n. 1
0
 def test_detector_splinefile(self):
     splineFile = UtilsTest.getimage("frelon.spline")
     detector = detectors.Detector()
     detector.set_splineFile(splineFile)
     widget = DetectorSelectorDrop()
     widget.setDetector(detector)
     newDetector = widget.detector()
     self.assertEqual(detector, newDetector)
Esempio n. 2
0
    def test_load_detector_with_distortion(self):
        # create detector and save it
        spline_detector = detectors.Detector()
        spline_detector.set_splineFile(os.path.join(unittest_data_path, 'distortion', 'f4mnew.spline'))
        spline_detector.save(os.path.join(unittest_data_path, 'detector_with_spline.h5'))

        QtWidgets.QFileDialog.getOpenFileName = MagicMock(
            return_value=os.path.join(unittest_data_path, 'detector_with_spline.h5'))
        click_button(self.widget.detector_load_btn)

        self.assertEqual(self.widget.spline_filename_txt.text(), 'from Detector')
Esempio n. 3
0
 def test_custom_detector(self):
     detector = detectors.Detector(pixel1=1, pixel2=2, max_shape=(100, 100))
     widget = DetectorSelectorDrop()
     widget.setDetector(detector)
     newDetector = widget.detector()
     self.assertEqual(detector, newDetector)
Esempio n. 4
0
 def test_detector(self):
     detector = detectors.Detector()
     widget = DetectorSelectorDrop()
     widget.setDetector(detector)
     newDetector = widget.detector()
     self.assertEqual(detector, newDetector)