#NEWLINE# def test_create_availabiltiy_zone_with_leading_trailing_spaces_compat_mode( self ) : #NEWLINE# #INDENT# def fake_mock_aggs( context , name , az ) : #NEWLINE# #INDENT# self . assertEqual ( 'nova1' , az ) #NEWLINE# return AGGREGATE #NEWLINE# #UNINDENT# with mock . patch . object ( compute_api . AggregateAPI , 'create_aggregate' ) as mock_aggs : #NEWLINE# #INDENT# mock_aggs . side_effect = mock_aggs #NEWLINE# self . req . set_legacy_v2 ( ) #NEWLINE# self . controller . create ( self . req , body = { #NEWLINE# #INDENT# 'aggregate' : { #NEWLINE# #INDENT# 'name' : 'test' , #NEWLINE# 'availability_zone' : '  nova1  ' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )