Author: bugman Date: Thu May 24 11:54:58 2012 New Revision: 16435 URL: http://svn.gna.org/viewcvs/relax?rev=16435&view=rev Log: Fix for the residue.create res_num arg unit test. This can now be None in relax! Modified: branches/uf_redesign/test_suite/unit_tests/_prompt/test_residue.py Modified: branches/uf_redesign/test_suite/unit_tests/_prompt/test_residue.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/test_suite/unit_tests/_prompt/test_residue.py?rev=16435&r1=16434&r2=16435&view=diff ============================================================================== --- branches/uf_redesign/test_suite/unit_tests/_prompt/test_residue.py (original) +++ branches/uf_redesign/test_suite/unit_tests/_prompt/test_residue.py Thu May 24 11:54:58 2012 @@ -25,7 +25,7 @@ # relax module imports. from prompt.interpreter import Interpreter -from relax_errors import RelaxIntError, RelaxNoneStrError, RelaxStrError +from relax_errors import RelaxIntError, RelaxNoneIntError, RelaxNoneStrError, RelaxStrError from test_suite.unit_tests.residue_testing_base import Residue_base_class # Unit test imports. @@ -95,7 +95,7 @@ # Loop over the data types. for data in DATA_TYPES: # Catch the None and str arguments, and skip them. - if data[0] == 'None' or data[0] == 'str': + if data[0] == 'None' or data[0] == 'str': continue # The argument test. @@ -107,113 +107,113 @@ # Loop over the data types. for data in DATA_TYPES: + # Catch the None, int and bin arguments, and skip them. + if data[0] == 'None' or data[0] == 'int' or data[0] == 'bin': + continue + + # The argument test. + self.assertRaises(RelaxNoneIntError, self.residue_fns.create, res_num=data[1], res_name='NH') + + + def test_create_argfail_res_name(self): + """Test the proper failure of the residue.create() user function for the res_name argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None and str arguments, and skip them. + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.residue_fns.create, res_name=data[1], res_num=1) + + + def test_create_argfail_mol_name(self): + """Test the proper failure of the residue.create() user function for the mol_name argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None and str arguments, and skip them. + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.residue_fns.create, mol_name=data[1], res_num=1, res_name='NH') + + + def test_delete_argfail_res_id(self): + """Test the proper failure of the residue.delete() user function for the res_id argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str arguments, and skip them. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.residue_fns.delete, res_id=data[1]) + + + def test_display_argfail_res_id(self): + """Test the proper failure of the residue.display() user function for the res_id argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the None and str arguments, and skip them. + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.residue_fns.display, res_id=data[1]) + + + def test_name_argfail_res_id(self): + """Test the proper failure of the residue.name() user function for the res_id argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str arguments, and skip them. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.residue_fns.name, res_id=data[1]) + + + def test_name_argfail_name(self): + """Test the proper failure of the residue.name() user function for the name argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str arguments, and skip them. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.residue_fns.name, name=data[1]) + + + def test_number_argfail_res_id(self): + """Test the proper failure of the residue.number() user function for the res_id argument.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str arguments, and skip them. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.residue_fns.number, res_id=data[1]) + + + def test_number_argfail_number(self): + """Test the proper failure of the residue.number() user function for the number argument.""" + + # Loop over the data types. + for data in DATA_TYPES: # Catch the int and bin arguments, and skip them. if data[0] == 'int' or data[0] == 'bin': continue # The argument test. - self.assertRaises(RelaxIntError, self.residue_fns.create, res_num=data[1], res_name='NH') - - - def test_create_argfail_res_name(self): - """Test the proper failure of the residue.create() user function for the res_name argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the None and str arguments, and skip them. - if data[0] == 'None' or data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxNoneStrError, self.residue_fns.create, res_name=data[1], res_num=1) - - - def test_create_argfail_mol_name(self): - """Test the proper failure of the residue.create() user function for the mol_name argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the None and str arguments, and skip them. - if data[0] == 'None' or data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxNoneStrError, self.residue_fns.create, mol_name=data[1], res_num=1, res_name='NH') - - - def test_delete_argfail_res_id(self): - """Test the proper failure of the residue.delete() user function for the res_id argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the str arguments, and skip them. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.residue_fns.delete, res_id=data[1]) - - - def test_display_argfail_res_id(self): - """Test the proper failure of the residue.display() user function for the res_id argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the None and str arguments, and skip them. - if data[0] == 'None' or data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxNoneStrError, self.residue_fns.display, res_id=data[1]) - - - def test_name_argfail_res_id(self): - """Test the proper failure of the residue.name() user function for the res_id argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the str arguments, and skip them. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.residue_fns.name, res_id=data[1]) - - - def test_name_argfail_name(self): - """Test the proper failure of the residue.name() user function for the name argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the str arguments, and skip them. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.residue_fns.name, name=data[1]) - - - def test_number_argfail_res_id(self): - """Test the proper failure of the residue.number() user function for the res_id argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the str arguments, and skip them. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.residue_fns.number, res_id=data[1]) - - - def test_number_argfail_number(self): - """Test the proper failure of the residue.number() user function for the number argument.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the int and bin arguments, and skip them. - if data[0] == 'int' or data[0] == 'bin': - continue - - # The argument test. self.assertRaises(RelaxIntError, self.residue_fns.number, res_id=':1', number=data[1])