Author: bugman Date: Sun Nov 25 18:38:16 2007 New Revision: 3931 URL: http://svn.gna.org/viewcvs/relax?rev=3931&view=rev Log: Added a unit test for the generic_fns.pipes.test() function. Modified: 1.3/test_suite/unit_tests/_generic_fns/test_pipes.py Modified: 1.3/test_suite/unit_tests/_generic_fns/test_pipes.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_generic_fns/test_pipes.py?rev=3931&r1=3930&r2=3931&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_generic_fns/test_pipes.py (original) +++ 1.3/test_suite/unit_tests/_generic_fns/test_pipes.py Sun Nov 25 18:38:16 2007 @@ -216,3 +216,26 @@ # Assert that a RelaxNoPipeError occurs when the pipe type is invalid. self.assertRaises(RelaxNoPipeError, pipes.switch, 'x') + + + def test_test(self): + """The throwing of RelaxNoPipeError when the pipe does not exist. + + The function tested is generic_fns.pipes.test(). + """ + + # The following should do nothing as the pipes exist. + pipes.test() + pipes.test('orig') + pipes.test('empty') + + # Assert that a RelaxNoPipeError occurs when the pipe doesn't exist. + self.assertRaises(RelaxNoPipeError, pipes.test, 'x') + + # Reset the relax data storage object. + relax_data_store.__reset__() + + # Now none of the following pipes exist, hence errors should be thrown. + self.assertRaises(RelaxNoPipeError, pipes.test) + self.assertRaises(RelaxNoPipeError, pipes.test, 'orig') + self.assertRaises(RelaxNoPipeError, pipes.test, 'empty')