Changeset fe78c7b in sasview for DataLoader/test
- Timestamp:
- Sep 5, 2009 11:45:29 AM (15 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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7d8c41f
- Parents:
- 4deaec6
- Location:
- DataLoader/test
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DataLoader/test/utest_abs_reader.py
rd00f8ff rfe78c7b 13 13 14 14 def setUp(self): 15 self.data = Loader().load("jan08002.ABS") 15 from DataLoader.readers.abs_reader import Reader 16 self.data = Reader().read("jan08002.ABS") 16 17 17 18 def test_checkdata(self): … … 24 25 """ 25 26 self.assertEqual(self.data.filename, "jan08002.ABS") 27 self.assertEqual(self.data.meta_data['loader'], "IGOR 1D") 26 28 27 29 self.assertEqual(self.data.source.wavelength_unit, 'A') … … 69 71 """ 70 72 self.assertEqual(self.data.filename, "S2-30dq.d1d") 73 # THIS FILE FORMAT IS CURRENTLY READ BY THE ASCII READER 74 self.assertEqual(self.data.meta_data['loader'], "ASCII") 71 75 self.assertEqual(len(self.data.x), 134) 72 76 self.assertEqual(len(self.data.y), 134) … … 93 97 """ 94 98 self.assertEqual(self.data.filename, "MAR07232_rest.ASC") 99 self.assertEqual(self.data.meta_data['loader'], "IGOR 2D") 95 100 96 101 self.assertEqual(self.data.source.wavelength_unit, 'A') … … 127 132 """ 128 133 self.assertEqual(self.data.filename, "MP_New.sans") 134 self.assertEqual(self.data.meta_data['loader'], "DANSE") 129 135 130 136 self.assertEqual(self.data.source.wavelength_unit, 'A') … … 169 175 170 176 self.assertEqual(self.data.run[0], "1234") 177 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 178 self.assertEqual(len(self.data.errors), 0) 171 179 172 180 # Data … … 325 333 self._checkdata() 326 334 335 def test_badunits(self): 336 """ 337 Check units. 338 Note that not all units are available. 339 """ 340 filename = "cansas1d_badunits.xml" 341 self.data = Loader().load(filename) 342 self.assertEqual(self.data.filename, filename) 343 # The followed should not have been loaded 344 self.assertEqual(self.data.sample.thickness, None) 345 # This one should 346 self.assertEqual(self.data.sample.transmission, 0.327) 347 348 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 349 self.assertEqual(len(self.data.errors), 1) 350 327 351 328 352 def test_slits(self): … … 356 380 357 381 if __name__ == '__main__': 382 import logging 383 logging.basicConfig(level=logging.INFO, 384 format='%(asctime)s %(levelname)s %(message)s', 385 filename='utest_abs_reader.log', 386 filemode='w') 358 387 unittest.main() 359 388 -
DataLoader/test/utest_ascii.py
raf76bd9 rfe78c7b 24 24 self.assertEqual(f.x[0],0.002618) 25 25 self.assertEqual(f.x[9],0.0497) 26 27 self.assertEqual(f.meta_data['loader'],"ASCII") 26 28 27 29 def test_truncated_1(self):
Note: See TracChangeset
for help on using the changeset viewer.