#NEWLINE# def test_show_capacities( self ) : #NEWLINE# #INDENT# if ( self . cell_extension == 'compute_extension:cells' ) : #NEWLINE# #INDENT# self . ext_mgr . is_loaded ( 'os-cell-capacities' ) . AndReturn ( True ) #NEWLINE# #UNINDENT# self . mox . StubOutWithMock ( req . controller . cells_rpcapi , 'get_capacities' ) #NEWLINE# response = { #NEWLINE# #INDENT# 'ram_free' : { #NEWLINE# #INDENT# 'units_by_mb' : { #NEWLINE# #INDENT# '8192' : 0 , #NEWLINE# '512' : 13 , #NEWLINE# '4096' : 1 , #NEWLINE# '2048' : 3 , #NEWLINE# '16384' : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'total_mb' : 7680 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'disk_free' : { #NEWLINE# #INDENT# 'units_by_mb' : { #NEWLINE# #INDENT# '81920' : 11 , #NEWLINE# '20480' : 46 , #NEWLINE# '40960' : 23 , #NEWLINE# '163840' : 5 , #NEWLINE# '0' : 0 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'total_mb' : 1052672 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . controller . cells_rpcapi . get_capacities ( self . context , cell_name = None ) . AndReturn ( response ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# req = self . _get_request ( 'cells/capacities' ) #NEWLINE# req . environ [ 'nova.context' ] = self . context #NEWLINE# res_dict = self . controller . capacities ( req ) #NEWLINE# self . assertEqual ( response , res_dict [ 'cell' ] [ 'capacities' ] )