#NEWLINE# def test_flavor_exists_exception_returns_409( self ) : #NEWLINE# #INDENT# expected = { #NEWLINE# #INDENT# 'flavor' : { #NEWLINE# #INDENT# 'name' : 'test' , #NEWLINE# 'ram' : 512 , #NEWLINE# 'vcpus' : 2 , #NEWLINE# 'disk' : 1 , #NEWLINE# 'OS-FLV-EXT-DATA:ephemeral' : 1 , #NEWLINE# 'id' : 1235 , #NEWLINE# 'swap' : 512 , #NEWLINE# 'rxtx_factor' : 1 , #NEWLINE# 'os-flavor-access:is_public' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# def fake_create( name , memory_mb , vcpus , root_gb , ephemeral_gb , flavorid , swap , rxtx_factor , is_public ) : #NEWLINE# #INDENT# raise exception . FlavorExists ( name = name ) #NEWLINE# #UNINDENT# self . stubs . Set ( flavors , 'create' , fake_create ) #NEWLINE# self . assertRaises ( webob . exc . HTTPConflict , self . controller . _create , self . _get_http_request ( ) , body = expected )