Changeset 5f26aa4 in sasview for test/sasdataloader
- Timestamp:
- Aug 19, 2016 9:03:10 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.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:
- 4abcc93a
- Parents:
- 09afe90
- git-author:
- Jeff Krzywon <krzywon@…> (08/19/16 09:03:10)
- git-committer:
- Jeff KRzywon <krzywon@…> (08/19/16 09:03:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_abs_reader.py
rb699768 r5f26aa4 176 176 177 177 self.assertEqual(self.data.run[0], "1234") 178 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 179 self.assertEqual(len(self.data.errors), 0) 178 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 180 179 181 180 # Data … … 198 197 self.assertEqual(self.data.sample.name, "my sample") 199 198 self.assertEqual(self.data.sample.thickness_unit, 'mm') 200 self.assert Equal(self.data.sample.thickness, 1.03)201 202 self.assert Equal(self.data.sample.transmission, 0.327)199 self.assertAlmostEqual(self.data.sample.thickness, 1.03) 200 201 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 203 202 204 203 self.assertEqual(self.data.sample.temperature_unit, 'C') … … 233 232 234 233 self.assertEqual(self.data.source.wavelength_max_unit, "nm") 235 self.assert Equal(self.data.source.wavelength_max, 1.0)234 self.assertAlmostEqual(self.data.source.wavelength_max, 1.0) 236 235 self.assertEqual(self.data.source.wavelength_min_unit, "nm") 237 self.assert Equal(self.data.source.wavelength_min, 0.22)236 self.assertAlmostEqual(self.data.source.wavelength_min, 0.22) 238 237 self.assertEqual(self.data.source.wavelength_spread_unit, "percent") 239 238 self.assertEqual(self.data.source.wavelength_spread, 14.3) … … 248 247 self.assertEqual(item.size_unit,'mm') 249 248 self.assertEqual(item.distance_unit,'mm') 250 249 251 250 if item.size.x==50 \ 252 251 and item.distance==11000.0 \ … … 294 293 self.assertTrue(item.date in ['04-Sep-2007 18:35:02', 295 294 '03-SEP-2006 11:42:47']) 295 print item.term 296 296 for t in item.term: 297 297 if t['name']=="ABS:DSTAND" \ … … 345 345 self.assertEqual(self.data.filename, filename) 346 346 # The followed should not have been loaded 347 self.assert Equal(self.data.sample.thickness, 0.00103)347 self.assertAlmostEqual(self.data.sample.thickness, 0.00103) 348 348 # This one should 349 self.assert Equal(self.data.sample.transmission, 0.327)350 351 self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D")349 self.assertAlmostEqual(self.data.sample.transmission, 0.327) 350 351 self.assertEqual(self.data.meta_data['loader'], "CanSAS XML 1D") 352 352 print self.data.errors 353 353 self.assertEqual(len(self.data.errors), 1) … … 385 385 386 386 if __name__ == '__main__': 387 unittest.main( testRunner=unittest.TextTestRunner(verbosity=2))387 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.