Changeset 3a473ef in sasview for test/sasdataloader/test/utest_sesans.py
- Timestamp:
- Aug 31, 2018 5:13:23 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c1cfa80
- Parents:
- aa1db44
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_sesans.py
ra78a02f r3a473ef 3 3 """ 4 4 5 import os.path 5 6 import unittest 6 7 from sas.sascalc.dataloader.loader_exceptions import FileContentsException,\ … … 8 9 from sas.sascalc.dataloader.readers.sesans_reader import Reader 9 10 from sas.sascalc.dataloader.loader import Loader 11 12 13 def find(filename): 14 return os.path.join(os.path.dirname(__file__), filename) 15 10 16 11 17 class sesans_reader(unittest.TestCase): … … 19 25 Test .SES in the full loader to make sure that the file type is correctly accepted 20 26 """ 21 file = Loader().load( "sesans_examples/sphere2micron.ses")27 file = Loader().load(find("sesans_examples/sphere2micron.ses")) 22 28 f = file[0] 23 29 # self.assertEqual(f, 5) 30 self.assertEqual(len(file), 1) 24 31 self.assertEqual(len(f.x), 40) 25 32 self.assertEqual(f.x[0], 391.56) … … 37 44 Test .SES loading on a TOF dataset 38 45 """ 39 file = self.loader( "sesans_examples/sphere_isis.ses")46 file = self.loader(find("sesans_examples/sphere_isis.ses")) 40 47 f = file[0] 48 self.assertEqual(len(file), 1) 41 49 self.assertEqual(len(f.x), 57) 42 50 self.assertEqual(f.x[-1], 19303.4) … … 54 62 FileContentsException, 55 63 self.loader, 56 "sesans_examples/sesans_no_data.ses")64 find("sesans_examples/sesans_no_data.ses")) 57 65 58 66 def test_sesans_no_spin_echo_unit(self): … … 63 71 FileContentsException, 64 72 self.loader, 65 "sesans_examples/no_spin_echo_unit.ses")73 find("sesans_examples/no_spin_echo_unit.ses")) 66 74 67 75 def test_sesans_future_version(self): … … 72 80 FileContentsException, 73 81 self.loader, 74 "sesans_examples/next_gen.ses")82 find("sesans_examples/next_gen.ses")) 75 83 76 84 def test_sesans_mandatory_headers(self): … … 81 89 FileContentsException, 82 90 self.loader, 83 "sesans_examples/no_wavelength.ses")91 find("sesans_examples/no_wavelength.ses")) 84 92 85 93 def test_sesans_columns_match_headers(self): … … 90 98 FileContentsException, 91 99 self.loader, 92 "sesans_examples/too_many_headers.ses")100 find("sesans_examples/too_many_headers.ses")) 93 101 94 102 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.