#NEWLINE# @ mock . patch ( '__builtin__.raw_input' ) #NEWLINE# def test_generate_raw_input_cancelled( self , raw_input ) : #NEWLINE# #INDENT# raw_input . side_effect = KeyboardInterrupt #NEWLINE# pyplate = self . _make_pyplate ( "        cft = CloudFormationTemplate('This is a test')\n        cft.parameters.update({\n            'Exists': options['ThisKeyExists'],\n            'DoesNotExist': options['ThisKeyDoesNotExist']\n        })" ) #NEWLINE# options_mapping_contents = dedent ( "        {\n            'ThisKeyExists': true\n        }\n        " ) #NEWLINE# options_mapping = NamedTemporaryFile ( ) #NEWLINE# options_mapping . write ( options_mapping_contents ) #NEWLINE# options_mapping . flush ( ) #NEWLINE# outfile = NamedTemporaryFile ( ) #NEWLINE# sys . argv = [ 'cfn_py_generate' , pyplate . name , outfile . name , '-o' , options_mapping . name ] #NEWLINE# with self . assertRaises ( SystemExit ) : #NEWLINE# #INDENT# self . _generate ( )