Changeset 6edd344 in sasview for src/sas/qtgui/Calculators/UnitTesting
- Timestamp:
- Mar 29, 2019 12:11:34 PM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_opencl
- Children:
- 7a1481f
- Parents:
- c02721c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py
rc02721c4 r6edd344 13 13 14 14 # Local 15 from sas.qtgui.Calculators.SldPanel import SldResult15 #from sas.qtgui.Calculators.SldPanel import SldResult 16 16 from sas.qtgui.Calculators.SldPanel import SldPanel 17 from sas.qtgui.Calculators.SldPanel import sldAlgorithm17 from sas.qtgui.Calculators.SldPanel import neutronSldAlgorithm, xraySldAlgorithm 18 18 from sas.qtgui.Utilities.GuiUtils import FormulaValidator 19 19 … … 22 22 if not QtWidgets.QApplication.instance(): 23 23 app = QtWidgets.QApplication(sys.argv) 24 25 class SldResultTest(unittest.TestCase):26 """ Test the simple container class"""27 def testObjectSize(self):28 results = SldResult(0.0, 0.0, 0.0, 0.0, 0.0, 0.0,29 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)30 self.assertEqual(sys.getsizeof(results), 56)31 24 32 25 … … 38 31 wavelength = 6.0 39 32 40 results = sldAlgorithm( molecular_formula,33 results = neutronSldAlgorithm( molecular_formula, 41 34 mass_density, 42 35 wavelength) 43 self.assertIsInstance(results, SldResult)36 #self.assertIsInstance(results, SldResult) 44 37 self.assertAlmostEqual(results.neutron_length, 0.175463, 5) 45 38 self.assertAlmostEqual(results.neutron_inc_xs, 5.365857, 5) … … 51 44 wavelength = 666.0 52 45 53 results = sldAlgorithm( molecular_formula,46 results = neutronSldAlgorithm( molecular_formula, 54 47 mass_density, 55 48 wavelength) 56 self.assertIsInstance(results, SldResult)49 #self.assertIsInstance(results, SldResult) 57 50 self.assertAlmostEqual(results.neutron_length, 0.059402, 5) 58 51 self.assertAlmostEqual(results.neutron_inc_xs, 0.145427, 5)
Note: See TracChangeset
for help on using the changeset viewer.