def test_kwarg_type(self):
        """kwarg values have the type of their default arguments"""
        with patch.object(MicroCLI, "exit") as mock_exit:
            cli = MicroCLITestCase.T([
                "script_name",
                "f7",
                "--int-option", "1",
                "--float-option", "2.5",
                "--bool-option1",
                "--bool-option2",
                "--string-option", "alma"])
            cli.stdout = StringIO()
            cli.run()
            self.assertEquals(
                cli.stdout.getvalue(),
                "int,1,float,2.5,bool,False,bool,True,str,alma\n")
            # successful execution exits with code 0
            mock_exit.assert_called_with(0)
def test_kwarg_type ( self ) : with patch . object ( MicroCLI , "exit" ) as mock_exit : cli = MicroCLITestCase . T ( [ "script_name" , "f7" , "--int-option" , "1" , "--float-option" , "2.5" , "--bool-option1" , "--bool-option2" , "--string-option" , "alma" ] ) cli . stdout = StringIO ( ) cli . run ( ) self . assertEquals ( cli . stdout . getvalue ( ) , "int,1,float,2.5,bool,False,bool,True,str,alma\n" ) mock_exit . assert_called_with ( 0 )
kwarg values have the type of their default arguments