Author: bugman Date: Sun Nov 25 17:50:26 2007 New Revision: 3920 URL: http://svn.gna.org/viewcvs/relax?rev=3920&view=rev Log: Wrote two unit tests for the diffusion tensor initialisation. One is for bad angular units, the other is for setting a spherical tensor. Modified: 1.3/test_suite/unit_tests/diffusion_tensor_testing_base.py Modified: 1.3/test_suite/unit_tests/diffusion_tensor_testing_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/diffusion_tensor_testing_base.py?rev=3920&r1=3919&r2=3920&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/diffusion_tensor_testing_base.py (original) +++ 1.3/test_suite/unit_tests/diffusion_tensor_testing_base.py Sun Nov 25 17:50:26 2007 @@ -54,3 +54,30 @@ """Reset the relax data storage object.""" relax_data_store.__reset__() + + + def test_init_bad_angle_units(self): + """Test the failure of setting up a diffusion tensor when the angle_units is incorrect. + + The functions tested are both generic_fns.diffusion_tensor.init() and + prompt.diffusion_tensor.init(). + """ + + # Initialise the tensor. + self.assertRaises(RelaxError, self.diffusion_tensor_fns.init, params=1e-9, angle_units='aaa') + + + def test_init_sphere(self): + """Test the setting up of a spherical diffusion tensor. + + The functions tested are both generic_fns.diffusion_tensor.init() and + prompt.diffusion_tensor.init(). + """ + + # Initialise the tensor. + self.diffusion_tensor_fns.init(params=1e-9) + + # Test the diffusion tensor + self.assertEqual(relax_data_pipe['orig'].diff.type, 'sphere') + self.assertEqual(relax_data_pipe['orig'].diff.tm, 1e-9) +