- Timestamp:
- Dec 14, 2016 5:41:30 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 0ba0774
- Parents:
- abc5e70
- Location:
- src/sas/qtgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/SlitSizeCalculator.py
rab9984e r886d2f2c 89 89 self.close() 90 90 91 def clearResults(self): 92 """ 93 Clear the content of output LineEdits 94 """ 95 self.slit_length_out.setText("ERROR!") 96 self.unit_out.clear() 97 91 98 def calculateSlitSize(self, data=None): 92 99 """ … … 95 102 96 103 if data is None: 104 self.clearResults() 97 105 msg = "ERROR: Data hasn't been loaded correctly" 98 106 raise RuntimeError, msg 99 107 100 108 if data.__class__.__name__ == 'Data2D': 109 self.clearResults() 101 110 msg = "Slit Length cannot be computed for 2D Data" 102 raise Exception, msg111 raise RuntimeError, msg 103 112 104 113 #compute the slit size … … 113 122 slit_length = slit_length_calculator.calculate_slit_length() 114 123 except: 124 self.clearResults() 115 125 msg = "Slit Size Calculator: %s" % (sys.exc_value) 116 126 raise RuntimeError, msg -
src/sas/qtgui/UnitTesting/SlitSizeCalculatorTest.py
rdebf5c3 r886d2f2c 83 83 loader = Loader() 84 84 data = loader.load(filename) 85 self.assertRaisesRegexp( Exception,85 self.assertRaisesRegexp(RuntimeError, 86 86 "Slit Length cannot be computed for 2D Data", 87 87 self.widget.calculateSlitSize, data)
Note: See TracChangeset
for help on using the changeset viewer.