Exemple #1
0
 def test_timeout_set_handle_error(self):
     """Test handling an error in setting the timeout"""
     shell = VisaShell()
     shell.current = True
     temp_stdout = StringIO()
     with redirect_stdout(temp_stdout):
         shell.do_timeout("1000")
     output = temp_stdout.getvalue()
     assert "no attribute" in output
    def test_timeout_get_handle_error(self):
        """Test handling an error in getting teh timeout.

        """
        shell = VisaShell()
        shell.current = True
        temp_stdout = StringIO()
        with redirect_stdout(temp_stdout):
            shell.do_timeout("")
        output = temp_stdout.getvalue()
        self.assertIn('no attribute', output)