Author: bugman Date: Fri Dec 5 16:05:49 2008 New Revision: 8148 URL: http://svn.gna.org/viewcvs/relax?rev=8148&view=rev Log: Wrote 7 arg unit tests for the as of yet non-existent noe.read() user function. Modified: 1.3/test_suite/unit_tests/_prompt/test_noe.py Modified: 1.3/test_suite/unit_tests/_prompt/test_noe.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_prompt/test_noe.py?rev=8148&r1=8147&r2=8148&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_prompt/test_noe.py (original) +++ 1.3/test_suite/unit_tests/_prompt/test_noe.py Fri Dec 5 16:05:49 2008 @@ -39,6 +39,97 @@ noe_fns = Noe(fake_relax.fake_instance()) + def test_read_argfail_file(self): + """The file arg test of the noe.read() user function.""" + + # Loop over the data types. + for data in DATA_TYPES: + # Catch the str argument, and skip it. + if data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxStrError, self.noe_fns.read, file=data[1]) + + + def test_read_argfail_dir(self): + """The dir arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', dir=data[1]) + + + def test_read_argfail_proton1_col(self): + """The proton1_col arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', proton1_col=data[1]) + + + def test_read_argfail_proton2_col(self): + """The proton2_col arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', proton2_col=data[1]) + + + def test_read_argfail_lower_col(self): + """The lower_col arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', lower_col=data[1]) + + + def test_read_argfail_upper_col(self): + """The upper_col arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', upper_col=data[1]) + + + def test_read_argfail_sep(self): + """The sep arg test of the noe.read() user function.""" + + # 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.noe_fns.read, file='noes', sep=data[1]) + + def test_spectrum_type_argfail_spectrum_type(self): """The spectrum_type arg test of the noe.spectrum_type() user function."""