Changeset 2387abc in sasview for test


Ignore:
Timestamp:
Aug 19, 2016 11:02:55 AM (4 years ago)
Author:
lewis
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.
Message:

Merge branch 'master' into corfunc

Location:
test
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_abs_reader.py

    rb699768 r5f26aa4  
    176176         
    177177        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") 
    180179         
    181180        # Data 
     
    198197        self.assertEqual(self.data.sample.name, "my sample") 
    199198        self.assertEqual(self.data.sample.thickness_unit, 'mm') 
    200         self.assertEqual(self.data.sample.thickness, 1.03) 
    201          
    202         self.assertEqual(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) 
    203202         
    204203        self.assertEqual(self.data.sample.temperature_unit, 'C') 
     
    233232         
    234233        self.assertEqual(self.data.source.wavelength_max_unit, "nm") 
    235         self.assertEqual(self.data.source.wavelength_max, 1.0) 
     234        self.assertAlmostEqual(self.data.source.wavelength_max, 1.0) 
    236235        self.assertEqual(self.data.source.wavelength_min_unit, "nm") 
    237         self.assertEqual(self.data.source.wavelength_min, 0.22) 
     236        self.assertAlmostEqual(self.data.source.wavelength_min, 0.22) 
    238237        self.assertEqual(self.data.source.wavelength_spread_unit, "percent") 
    239238        self.assertEqual(self.data.source.wavelength_spread, 14.3) 
     
    248247            self.assertEqual(item.size_unit,'mm') 
    249248            self.assertEqual(item.distance_unit,'mm') 
    250              
     249 
    251250            if item.size.x==50 \ 
    252251                and item.distance==11000.0 \ 
     
    294293            self.assertTrue(item.date in ['04-Sep-2007 18:35:02', 
    295294                                          '03-SEP-2006 11:42:47']) 
     295            print item.term 
    296296            for t in item.term: 
    297297                if t['name']=="ABS:DSTAND" \ 
     
    345345        self.assertEqual(self.data.filename, filename) 
    346346        # The followed should not have been loaded 
    347         self.assertEqual(self.data.sample.thickness, 0.00103) 
     347        self.assertAlmostEqual(self.data.sample.thickness, 0.00103) 
    348348        # This one should 
    349         self.assertEqual(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") 
    352352        print self.data.errors 
    353353        self.assertEqual(len(self.data.errors), 1) 
     
    385385 
    386386if __name__ == '__main__': 
    387     unittest.main(testRunner=unittest.TextTestRunner(verbosity=2)) 
     387    unittest.main() 
  • test/sasdataloader/test/utest_cansas.py

    r83b6408 r1686a333  
    9999        self.assertTrue(data.detector[1].name == "main-detector-bank") 
    100100        self.assertTrue(data.detector[0].distance == 575.0) 
    101         self.assertTrue(data.detector[1].distance == 4145.02) 
     101        self.assertAlmostEqual(data.detector[1].distance, 4145.02) 
    102102        self.assertTrue(data.process[0].name == "Mantid generated CanSAS1D XML") 
    103103        self.assertTrue(data.meta_data["xmlpreprocess"] != None) 
     
    176176        data = list[0] 
    177177        self.assertTrue(data.x.size == 2) 
    178         self.assertTrue(len(data.meta_data) == 3) 
     178        self.assertTrue(len(data.meta_data) == 2) 
    179179        self.assertTrue(len(data.errors) == 1) 
    180180        self.assertTrue(data.detector[0].distance_unit == "mm") 
Note: See TracChangeset for help on using the changeset viewer.