Author: bugman Date: Wed Apr 3 15:07:45 2013 New Revision: 19330 URL: http://svn.gna.org/viewcvs/relax?rev=19330&view=rev Log: Unit test fixes for the prompt relax_disp user function argument checks. Modified: branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py Modified: branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py?rev=19330&r1=19329&r2=19330&view=diff ============================================================================== --- branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py (original) +++ branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py Wed Apr 3 15:07:45 2013 @@ -49,8 +49,8 @@ self.relax_disp_fns = self.interpreter.relax_disp - def test_relax_calc_r2eff_argfail_exp_type(self): - """The exp_type arg test of the relax_disp.relax_calc_r2eff() user function.""" + def test_calc_r2eff_argfail_exp_type(self): + """The exp_type arg test of the relax_disp.calc_r2eff() user function.""" # Loop over the data types. for data in DATA_TYPES: @@ -62,8 +62,8 @@ self.assertRaises(RelaxStrError, self.relax_disp_fns.calc_r2eff, exp_type=data[1]) - def test_relax_calc_r2eff_argfail_id(self): - """The id arg test of the relax_disp.relax_calc_r2eff() user function.""" + def test_calc_r2eff_argfail_id(self): + """The id arg test of the relax_disp.calc_r2eff() user function.""" # Loop over the data types. for data in DATA_TYPES: @@ -75,21 +75,34 @@ self.assertRaises(RelaxStrError, self.relax_disp_fns.calc_r2eff, id=data[1]) - def test_relax_calc_r2eff_argfail_delayT(self): - """The delayT arg test of the relax_disp.relax_calc_r2eff() user function.""" + def test_calc_r2eff_argfail_delayT(self): + """The delayT arg test of the relax_disp.calc_r2eff() user function.""" # Loop over the data types. for data in DATA_TYPES: - # Catch the float, int and None arguments, and skip them. - if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin' or data[0] == 'None': + # Catch the float, int and bin arguments, and skip them. + if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin': continue # The argument test. - self.assertRaises(RelaxNoneNumError, self.relax_disp_fns.calc_r2eff, id='test', delayT=data[1]) + self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', delayT=data[1]) - def test_relax_calc_r2eff_argfail_int_cpmg(self): - """The int_cpmg arg test of the relax_disp.relax_calc_r2eff() user function.""" + def test_calc_r2eff_argfail_int_cpmg(self): + """The int_cpmg arg test of the relax_disp.calc_r2eff() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the float, int and bin arguments, and skip them. + if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin': + continue + + # The argument test. + self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', int_cpmg=data[1]) + + + def test_calc_r2eff_argfail_int_ref(self): + """The int_ref arg test of the relax_disp.calc_r2eff() user function.""" # Loop over the data types. for data in DATA_TYPES: @@ -98,20 +111,7 @@ continue # The argument test. - self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', int_cpmg=data[1]) - - - def test_relax_calc_r2eff_argfail_int_ref(self): - """The int_ref arg test of the relax_disp.relax_calc_r2eff() user function.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the float, int and None arguments, and skip them. - if data[0] == 'float' or data[0] == 'int' or data[0] == 'bin': - continue - - # The argument test. - self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', int_ref=data[1]) + self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', int_cpmg=10, int_ref=data[1]) def test_relax_cpmg_delayT_argfail_id(self): @@ -137,7 +137,7 @@ continue # The argument test. - self.assertRaises(RelaxNoneNumError, self.relax_disp_fns.cpmg_delayT, delayT=data[1]) + self.assertRaises(RelaxNumError, self.relax_disp_fns.cpmg_delayT, id='test', delayT=data[1]) def test_relax_cpmg_frq_argfail_cpmg_frq(self): @@ -150,7 +150,7 @@ continue # The argument test. - self.assertRaises(RelaxNoneNumError, self.relax_disp_fns.cpmg_frq, cpmg_frq=data[1]) + self.assertRaises(RelaxNoneNumError, self.relax_disp_fns.cpmg_frq, spectrum_id='test', cpmg_frq=data[1]) def test_relax_cpmg_frq_argfail_spectrum_id(self):