Changeset ade1080 in sasview for test/sasdataloader
- Timestamp:
- Apr 9, 2017 4:40:35 AM (8 years ago)
- Branches:
- master, 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 10ab40e
- Parents:
- a79ab31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_sesans.py
ra79ab31 rade1080 4 4 5 5 import unittest 6 from sas.sascalc.dataloader. loader import Loader6 from sas.sascalc.dataloader.readers.sesans_reader import Reader 7 7 8 8 … … 10 10 11 11 def setUp(self): 12 self.loader = Loader() 12 reader = Reader() 13 self.loader = reader.read 13 14 14 15 def test_sesans_load(self): … … 16 17 Test .SES file loading 17 18 """ 18 f = self.loader .load("sesans_examples/sphere2micron.ses")19 f = self.loader("sesans_examples/sphere2micron.ses") 19 20 # self.assertEqual(f, 5) 20 21 self.assertEqual(len(f.x), 40) … … 33 34 Test .SES loading on a TOF dataset 34 35 """ 35 f = self.loader .load("sesans_examples/sphere_isis.ses")36 f = self.loader("sesans_examples/sphere_isis.ses") 36 37 self.assertEqual(len(f.x), 57) 37 38 self.assertEqual(f.x[-1], 19303.4) … … 46 47 Test .SES loading on a TOF dataset 47 48 """ 48 f = self.loader.load("sesans_examples/sesans_no_data.ses") 49 self.assertEqual(len(f.x), 57) 50 self.assertEqual(f.x[-1], 19303.4) 51 self.assertEqual(f.source.wavelength[-1], 13.893668) 52 self.assertEqual(f.source.wavelength[0], 1.612452) 53 self.assertEqual(f.sample.yacceptance, (0.09, "radians")) 54 self.assertEqual(f.sample.zacceptance, (0.09, "radians")) 55 self.assertEqual(f.sample.thickness, 0.2) 49 self.assertRaises( 50 RuntimeError, 51 self.loader, 52 "sesans_examples/sesans_no_data.ses") 56 53 57 54 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.