#NEWLINE# def test_capacity_part_reserve( self ) : #NEWLINE# #INDENT# cap = self . _capacity ( 50.0 ) #NEWLINE# cell_free_ram = sum ( ( compute [ 3 ] for compute in FAKE_COMPUTES ) ) #NEWLINE# self . assertEqual ( cell_free_ram , cap [ 'ram_free' ] [ 'total_mb' ] ) #NEWLINE# cell_free_disk = ( 1024 * sum ( ( compute [ 4 ] for compute in FAKE_COMPUTES ) ) ) #NEWLINE# self . assertEqual ( cell_free_disk , cap [ 'disk_free' ] [ 'total_mb' ] ) #NEWLINE# self . assertEqual ( 0 , cap [ 'ram_free' ] [ 'units_by_mb' ] [ '0' ] ) #NEWLINE# self . assertEqual ( 0 , cap [ 'disk_free' ] [ 'units_by_mb' ] [ '0' ] ) #NEWLINE# units = 10 #NEWLINE# self . assertEqual ( units , cap [ 'ram_free' ] [ 'units_by_mb' ] [ '50' ] ) #NEWLINE# sz = ( 25 * 1024 ) #NEWLINE# units = 2 #NEWLINE# self . assertEqual ( units , cap [ 'disk_free' ] [ 'units_by_mb' ] [ str ( sz ) ] )