Author: bugman Date: Fri Nov 23 17:13:41 2007 New Revision: 3865 URL: http://svn.gna.org/viewcvs/relax?rev=3865&view=rev Log: Implemented all the arg unit tests for the sequence.display() user function. Modified: 1.3/test_suite/unit_tests/_prompt/test_sequence.py Modified: 1.3/test_suite/unit_tests/_prompt/test_sequence.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_prompt/test_sequence.py?rev=3865&r1=3864&r2=3865&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_prompt/test_sequence.py (original) +++ 1.3/test_suite/unit_tests/_prompt/test_sequence.py Fri Nov 23 17:13:41 2007 @@ -52,6 +52,84 @@ sequence_fns = Sequence(relax) + def test_display_argfail_mol_name_col(self): + """The proper failure of the sequence.display() user function for the mol_name_col argument.""" + + # 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.sequence_fns.display, file='a', mol_name_col=data[1]) + + + def test_display_argfail_res_num_col(self): + """The proper failure of the sequence.display() user function for the res_num_col argument.""" + + # 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.sequence_fns.display, file='a', res_num_col=data[1]) + + + def test_display_argfail_res_name_col(self): + """The proper failure of the sequence.display() user function for the res_name_col argument.""" + + # 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.sequence_fns.display, file='a', res_name_col=data[1]) + + + def test_display_argfail_spin_num_col(self): + """The proper failure of the sequence.display() user function for the spin_num_col argument.""" + + # 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.sequence_fns.display, file='a', spin_num_col=data[1]) + + + def test_display_argfail_spin_name_col(self): + """The proper failure of the sequence.display() user function for the spin_name_col argument.""" + + # 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.sequence_fns.display, file='a', spin_name_col=data[1]) + + + def test_display_argfail_sep(self): + """The proper failure of the sequence.display() user function for the sep 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.sequence_fns.display, file='a', sep=data[1]) + + def test_read_argfail_file(self): """Test the proper failure of the sequence.read() user function for the file argument."""