def test_add_TOFs_for_ROI_is_correct(self): # Arrange start = 125 end = 10000 inst = instruments.LOQ() inst.set_TOFs_for_ROI(start, end) # Act start_Tof, end_Tof = inst.get_TOFs_for_ROI() # Assert self.assertEqual(start, start_Tof) self.assertEqual(end, end_Tof)
def test_Tofs_for_ROI_are_reset_to_None(self): # Arrange start = 125 end = 10000 inst = instruments.LOQ() inst.set_TOFs_for_ROI(start, end) inst.reset_TOFs_for_ROI() # Act start_Tof, end_Tof = inst.get_TOFs_for_ROI() # Assert self.assertEqual(None, start_Tof) self.assertEqual(None, end_Tof)
def _get_correct_instrument(self, instrument_name, idf_path=None): ''' Creates an ISIS instrument based on the name and the chosen idf_path @param instrument_name: the name of the instrument @param idf_path: the full path to the IDF ''' instrument = None try: if instrument_name.upper() == "LARMOR": instrument = isis_instrument.LARMOR(idf_path) elif instrument_name.upper() == "SANS2D": instrument = isis_instrument.SANS2D(idf_path) elif instrument_name.upper() == "LOQ": instrument = isis_instrument.LOQ(idf_path) # pylint: disable=bare-except except: instrument = None return instrument