Changeset 9fafa39 in sasview for sansmodels/test


Ignore:
Timestamp:
Feb 8, 2012 5:02:06 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
0a90d92
Parents:
1b023334
Message:

added test for new fractals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/test/utest_other_models.py

    rdd0d059 r9fafa39  
    17271727        """ Test line at the critical point""" 
    17281728        self.assert_(numpy.isfinite(self.comp.run(0.0))) 
    1729   
     1729 
     1730class TestMassFractalModel(unittest.TestCase): 
     1731    """ Unit tests for MassFractalModel: Need to verify the test value""" 
     1732     
     1733    def setUp(self): 
     1734        from sans.models.MassFractalModel import MassFractalModel 
     1735        self.comp = MassFractalModel() 
     1736         
     1737    def testEval_1D(self): 
     1738        """ Test 1D model for a MassFractalModel""" 
     1739        self.assertAlmostEquals(self.comp.run(0.05), 279.59322, 4) 
     1740 
     1741class TestSurfaceFractalModel(unittest.TestCase): 
     1742    """ Unit tests for SurfaceFractalModel: Need to verify the test value""" 
     1743     
     1744    def setUp(self): 
     1745        from sans.models.SurfaceFractalModel import SurfaceFractalModel 
     1746        self.comp = SurfaceFractalModel() 
     1747         
     1748    def testEval_1D(self): 
     1749        """ Test 1D model for a SurfaceFractal""" 
     1750        self.assertAlmostEquals(self.comp.run(0.05), 301428.65916, 4) 
     1751 
     1752class TestMassSurfaceFractal(unittest.TestCase): 
     1753    """ Unit tests for MassSurfaceFractal: Need to verify the test value""" 
     1754     
     1755    def setUp(self): 
     1756        from sans.models.MassSurfaceFractal import MassSurfaceFractal 
     1757        self.comp = MassSurfaceFractal() 
     1758         
     1759    def testEval_1D(self): 
     1760        """ Test 1D model for a MassSurfaceFractal""" 
     1761        self.assertAlmostEquals(self.comp.run(0.05), 1.77537e-05, 4) 
     1762         
    17301763if __name__ == '__main__': 
    17311764    unittest.main() 
Note: See TracChangeset for help on using the changeset viewer.