#NEWLINE# @ trap_exit_fail #NEWLINE# def test_command_subcommands( ) : #NEWLINE# #INDENT# with patch . object ( ComplexCommandLine , '_main' ) as _main : #NEWLINE# #INDENT# with patch . object ( ComplexCommandLine , '_sub' ) as _sub : #NEWLINE# #INDENT# c = ComplexCommandLine ( ) #NEWLINE# args = c . parse ( [ 'sub' , '--launch' , '--launch2' , 'True' ] ) #NEWLINE# c . run ( args ) #NEWLINE# assert ( not _main . called ) #NEWLINE# assert ( _sub . call_count == 1 )