Exemplo n.º 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
Exemplo n.º 2
0
    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)