#NEWLINE# def test_failedCommandProvidesOutput( self ) : #NEWLINE# #INDENT# "\n        If a subprocess fails, L{BookBuilder.buildPDF} raises L{CommandFailed}\n        with the subprocess's output and leaves the temporary directory as a\n        sibling of the book path.\n        " #NEWLINE# bookTeX = FilePath ( ( self . mktemp ( ) + '.tex' ) ) #NEWLINE# builder = BookBuilder ( ) #NEWLINE# inputState = bookTeX . parent ( ) . children ( ) #NEWLINE# exc = self . assertRaises ( CommandFailed , builder . buildPDF , bookTeX , self . howtoDir , FilePath ( self . mktemp ( ) ) ) #NEWLINE# self . assertTrue ( exc . output ) #NEWLINE# newOutputState = ( set ( bookTeX . parent ( ) . children ( ) ) - set ( exc ) ) #NEWLINE# self . assertEqual ( len ( newOutputState ) , 1 ) #NEWLINE# workPath = newOutputState . pop ( ) #NEWLINE# self . assertTrue ( workPath . isdir ( ) , ( 'Expected work path %r was not a directory.' % ( workPath . path , ) ) )