

def test_basic_costing(self):
    hosts = [FakeHost(1, (512 * MB), 100), FakeHost(2, (256 * MB), 400), FakeHost(3, (512 * MB), 100)]
    weighted_fns = [(1, (lambda h: h.free_ram)), (2, (lambda h: h.io))]
    costs = least_cost.weighted_sum(domain=hosts, weighted_fns=weighted_fns)
    expected = [1.5, 2.5, 1.5]
    self.assertEqual(expected, costs)

dataset/ETHPy150Open nii-cloud/dodai-compute/nova/tests/scheduler/test_least_cost_scheduler.py WeightedSumTestCase.test_basic_costing/original