Changeset 5f43ff9 in sasview for sansmodels/src/sans/models/test


Ignore:
Timestamp:
Jul 19, 2011 11:00:27 AM (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:
d771c72
Parents:
ff18c58
Message:

update model io test

File:
1 edited

Legend:

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

    rd67fc8d r5f43ff9  
     1#!/usr/bin/env python 
     2"""  
     3    Test for setstate and reduce_ex operations for models 
     4""" 
    15import unittest 
    26 
     
    1317        """ 
    1418        self.sphere.setParam('radius', 44.0) 
    15         state = self.sphere.__getstate__() 
     19        _, _, state, _, _ = self.sphere.__reduce_ex__(0) 
    1620         
    1721        sphere_copy = SphereModel() 
    1822        sphere_copy.__setstate__(state) 
    19          
     23        sphere_clone = sphere_copy.clone() 
    2024        self.assertEqual(sphere_copy.getParam('radius'), 44) 
    2125         
    2226        self.sphere.setParam('radius', 33.0) 
    2327         
    24         self.assertEqual(sphere_copy.getParam('radius'), 44) 
     28        self.assertEqual(sphere_clone.getParam('radius'), 44) 
    2529         
    2630     
Note: See TracChangeset for help on using the changeset viewer.