#NEWLINE# @ mock . patch ( '__builtin__.raw_input' ) #NEWLINE# def test_generate( self , raw_input ) : #NEWLINE# #INDENT# 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 , pyplate . name , '-o' , options_mapping . name ] #NEWLINE# input_value = 'Test' #NEWLINE# raw_input . return_value = input_value #NEWLINE# self . _generate ( ) #NEWLINE# template = json . load ( outfile ) #NEWLINE# self . assertTrue ( template [ 'Parameters' ] [ 'Exists' ] ) #NEWLINE# self . assertEqual ( template [ 'Parameters' ] [ 'DoesNotExist' ] , input_value )