- Timestamp:
- Aug 19, 2016 11:02:55 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 6f343e3
- Parents:
- 32c5983 (diff), 45d7662 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- test
- Files:
-
- 2 added
- 2 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() -
test/sasdataloader/test/utest_cansas.py
r83b6408 r1686a333 99 99 self.assertTrue(data.detector[1].name == "main-detector-bank") 100 100 self.assertTrue(data.detector[0].distance == 575.0) 101 self.assert True(data.detector[1].distance ==4145.02)101 self.assertAlmostEqual(data.detector[1].distance, 4145.02) 102 102 self.assertTrue(data.process[0].name == "Mantid generated CanSAS1D XML") 103 103 self.assertTrue(data.meta_data["xmlpreprocess"] != None) … … 176 176 data = list[0] 177 177 self.assertTrue(data.x.size == 2) 178 self.assertTrue(len(data.meta_data) == 3)178 self.assertTrue(len(data.meta_data) == 2) 179 179 self.assertTrue(len(data.errors) == 1) 180 180 self.assertTrue(data.detector[0].distance_unit == "mm")
Note: See TracChangeset
for help on using the changeset viewer.