Changeset 8cfdd5e in sasview for sansmodels/src/sans/models/test


Ignore:
Timestamp:
Mar 17, 2009 1:47:45 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
bb18ef1
Parents:
4d74a8f
Message:

fix setParam for modelMulplication, add 1 unittest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/test/utest_modelmultiplication.py

    rc9636f7 r8cfdd5e  
    2727    fixed=[] 
    2828    fixed=['radius.width'] 
     29     
     30     
     31    def test_multiplication(self): 
     32        """ test multiplication model""" 
     33        from sans.models.MultiplicationModel import MultiplicationModel 
     34        from sans.models.SphereModel import SphereModel 
     35        from sans.models.NoStructure import NoStructure 
     36        model1  =  MultiplicationModel(SphereModel(),NoStructure()) 
     37        model2 = SphereModel() 
     38        x= 2 
     39        a = model1.run(x) 
     40         
     41        b=  model2.run(x) 
     42        self.assertEqual(a, b) 
     43        model2.setParam("scale", 10) 
     44        c=  model2.run(x) 
     45        self.assertEqual(c, 10*b) 
     46        model1.setParam("scale", 10) 
     47        d=  model1.run(x) 
     48        self.assertEqual(d, 10*a) 
     49        self.assertEqual(model1.getParam("scale"), 10) 
     50         
     51         
    2952    def testMultiplicationModel(self): 
    3053        """ Test Multiplication  sphere with SquareWellStructure""" 
Note: See TracChangeset for help on using the changeset viewer.