#NEWLINE# @ mock . patch ( 'cfn_pyplates.exceptions.Error' ) #NEWLINE# def test_callable_generate_no_template( self , error ) : #NEWLINE# #INDENT# pyplate_contents = '' #NEWLINE# pyplate = NamedTemporaryFile ( ) #NEWLINE# pyplate . write ( pyplate_contents ) #NEWLINE# pyplate . flush ( ) #NEWLINE# error . return_value = Exception ( 'I am a test mock, this traceback is expected.' ) #NEWLINE# core . generate_pyplate ( pyplate . name ) #NEWLINE# error . assert_called_once_with ( 'No CloudFormationTemplate found in pyplate' )