#NEWLINE# @ mock . patch . object ( heat . api , 'heat' ) #NEWLINE# def test_validate_post( self , hc ) : #NEWLINE# #INDENT# body = '{"template_url":"http://localhost/template.yaml"}' #NEWLINE# request = self . mock_rest_request ( body = body ) #NEWLINE# hc . template_validate . return_value = { #NEWLINE# #INDENT# 'Description' : 'foo' , #NEWLINE# #UNINDENT# } #NEWLINE# response = heat . Validate ( ) . post ( request ) #NEWLINE# self . assertStatusCode ( response , 200 ) #NEWLINE# self . assertEqual ( response . json , { #NEWLINE# #INDENT# 'Description' : 'foo' , #NEWLINE# #UNINDENT# } ) #NEWLINE# kwargs = json . loads ( body ) #NEWLINE# hc . template_validate . assert_called_once_with ( response , ** kwargs )