コード例 #1
0
 def test_that_raises_when_lower_wavelength_is_smaller_than_high_wavelength(
         self):
     state = StateWavelengthAndPixelAdjustment()
     state.wavelength_low = [2.]
     state.wavelength_high = [1.]
     state.wavelength_step = 2.
     state.wavelength_step_type = RangeStepType.LIN
     with self.assertRaises(ValueError):
         state.validate()
コード例 #2
0
    def test_that_raises_when_wavelength_entry_is_missing(self):
        # Arrange
        state = StateWavelengthAndPixelAdjustment()
        with self.assertRaises(ValueError):
            state.validate()

        state.wavelength_low = [1.]
        with self.assertRaises(ValueError):
            state.validate()

        state.wavelength_high = [2.]
        with self.assertRaises(ValueError):
            state.validate()

        state.wavelength_step = 2.
        with self.assertRaises(ValueError):
            state.validate()

        state.wavelength_step_type = RangeStepType.LIN
        self.assertIsNone(state.validate())