def test_help(self):
        """defined commands appear in the help message"""
        with patch.object(MicroCLI, "exit") as mock_exit:
            cli = MicroCLITestCase.T(["script_name", "help"], StringIO())
            cli.run()
            output = cli.stdout.getvalue()
            print output
            self.assertTrue(output.startswith("Usage: "))
            # successful execution exits with code 0
            mock_exit.assert_called_with(0)
def test_help ( self ) : with patch . object ( MicroCLI , "exit" ) as mock_exit : cli = MicroCLITestCase . T ( [ "script_name" , "help" ] , StringIO ( ) ) cli . run ( ) output = cli . stdout . getvalue ( ) print output self . assertTrue ( output . startswith ( "Usage: " ) ) mock_exit . assert_called_with ( 0 )
defined commands appear in the help message