#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . trove : ( 'flavor_list' , 'backup_list' , 'instance_create' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_create_simple_instance_exception( self ) : #NEWLINE# #INDENT# trove_exception = self . exceptions . nova #NEWLINE# api . trove . flavor_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . flavors . list ( ) ) #NEWLINE# api . trove . backup_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . database_backups . list ( ) ) #NEWLINE# api . trove . instance_create ( IsA ( http . HttpRequest ) , IsA ( unicode ) , IsA ( int ) , IsA ( unicode ) , databases = None , restore_point = None , users = None ) . AndRaise ( trove_exception ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# post = { #NEWLINE# #INDENT# 'name' : 'MyDB' , #NEWLINE# 'volume' : '1' , #NEWLINE# 'flavor' : 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . client . post ( LAUNCH_URL , post ) #NEWLINE# self . assertRedirectsNoFollow ( res , INDEX_URL )