Author: bugman Date: Sun Nov 25 22:21:30 2007 New Revision: 3970 URL: http://svn.gna.org/viewcvs/relax?rev=3970&view=rev Log: Added 2 unit tests for the failure of the diffusion tensor deletion. 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=3970&r1=3969&r2=3970&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 22:21:30 2007 @@ -22,7 +22,7 @@ # relax module imports. from data import Data as relax_data_store -from relax_errors import RelaxError, RelaxNoPipeError, RelaxResSelectDisallowError, RelaxSpinSelectDisallowError +from relax_errors import RelaxError, RelaxNoPipeError, RelaxResSelectDisallowError, RelaxSpinSelectDisallowError, RelaxTensorError @@ -71,6 +71,31 @@ # Test that tm is not 0.0. self.assertNotEqual(relax_data_store['orig'].diff_tensor.tm, 0.0) + + + def test_delete_fail_no_data(self): + """Failure of deletion of the diffusion tensor data structure when there is no data. + + The functions tested are both generic_fns.diffusion_tensor.delete() and + prompt.diffusion_tensor.delete(). + """ + + # Try to delete the tensor data. + self.assertRaises(RelaxTensorError, self.diffusion_tensor_fns.delete) + + + def test_delete_fail_no_pipe(self): + """Failure of deletion of the diffusion tensor data structure when there is no data pipe. + + The functions tested are both generic_fns.diffusion_tensor.delete() and + prompt.diffusion_tensor.delete(). + """ + + # Reset the relax data store. + relax_data_store.__reset__() + + # Try to delete the tensor data. + self.assertRaises(RelaxNoPipeError, self.diffusion_tensor_fns.delete) def test_init_bad_angle_units(self):