Changeset 5f43ff9 in sasview for sansmodels/src/sans/models/test
- Timestamp:
- Jul 19, 2011 11:00:27 AM (13 years ago)
- 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
- 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 """ 1 5 import unittest 2 6 … … 13 17 """ 14 18 self.sphere.setParam('radius', 44.0) 15 state = self.sphere.__getstate__()19 _, _, state, _, _ = self.sphere.__reduce_ex__(0) 16 20 17 21 sphere_copy = SphereModel() 18 22 sphere_copy.__setstate__(state) 19 23 sphere_clone = sphere_copy.clone() 20 24 self.assertEqual(sphere_copy.getParam('radius'), 44) 21 25 22 26 self.sphere.setParam('radius', 33.0) 23 27 24 self.assertEqual(sphere_c opy.getParam('radius'), 44)28 self.assertEqual(sphere_clone.getParam('radius'), 44) 25 29 26 30
Note: See TracChangeset
for help on using the changeset viewer.