'Test that cells with less ram available return a higher weight.'

def test_negative_multiplier(self):

    self.flags(ram_weight_multiplier=(-1.0), group='cells')
    cells = _get_fake_cells()
    instance_type = {'memory_mb': 512}
    weight_properties = {'request_spec': {'instance_type': instance_type}}
    weighed_cells = self._get_weighed_cells(cells, weight_properties)
    self.assertEqual(4, len(weighed_cells))
    resulting_cells = [weighed_cell.obj for weighed_cell in weighed_cells]
    expected_cells = [cells[0], cells[1], cells[2], cells[3]]
    self.assertEqual(expected_cells, resulting_cells)
    instance_type = {'memory_mb': 1024}
    weight_properties = {'request_spec': {'instance_type': instance_type}}
    weighed_cells = self._get_weighed_cells(cells, weight_properties)
    self.assertEqual(4, len(weighed_cells))
    resulting_cells = [weighed_cell.obj for weighed_cell in weighed_cells]
    expected_cells = [cells[3], cells[2], cells[1], cells[0]]
    self.assertEqual(expected_cells, resulting_cells)
    instance_type = {'memory_mb': 2048}
    weight_properties = {'request_spec': {'instance_type': instance_type}}
    weighed_cells = self._get_weighed_cells(cells, weight_properties)
    self.assertEqual(4, len(weighed_cells))
    resulting_cells = [weighed_cell.obj for weighed_cell in weighed_cells]
    expected_cells = [cells[2], cells[3], cells[0], cells[1]]
    self.assertEqual(expected_cells, resulting_cells)
