Changeset e390933 in sasview for DataLoader/test


Ignore:
Timestamp:
Sep 2, 2008 2:32:02 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
daa56d0
Parents:
1b162dfa
Message:

Added unit conversion tests for data loader.

Location:
DataLoader/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/test/utest_abs_reader.py

    r579ba85 re390933  
    158158        self.assertEqual(self.data.dy[0], 3) 
    159159        self.assertEqual(self.data.x[1], 0.03) 
    160         self.assertEqual(self.data.y[1], 1001) 
     160        self.assertAlmostEquals(self.data.y[1], 1001.0) 
    161161        self.assertEqual(self.data.dx[1], 0.02) 
    162162        self.assertEqual(self.data.dy[1], 4) 
     
    294294        self._checkdata() 
    295295         
    296          
     296    def test_units(self): 
     297        """ 
     298            Check units. 
     299            Note that not all units are available. 
     300        """ 
     301        filename = "cansas1d_units.xml" 
     302        self.data = Loader().load(filename) 
     303        self.assertEqual(self.data.filename, filename) 
     304        self._checkdata() 
    297305         
    298306         
Note: See TracChangeset for help on using the changeset viewer.