#NEWLINE# def test_update_with_duplicated_name( self ) : #NEWLINE# #INDENT# test_metadata = { #NEWLINE# #INDENT# 'aggregate' : { #NEWLINE# #INDENT# 'name' : 'test_name' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# def stub_update_aggregate( context , aggregate , metadata ) : #NEWLINE# #INDENT# raise exception . AggregateNameExists ( aggregate_name = 'test_name' ) #NEWLINE# #UNINDENT# self . stubs . Set ( test_metadata . controller . api , 'update_aggregate' , stub_update_aggregate ) #NEWLINE# self . assertRaises ( exc . HTTPConflict , self . controller . update , self . req , '2' , body = test_metadata )