

def test_get_scheduler_hint(self):
    spec_obj = objects.RequestSpec(scheduler_hints={
        'foo_single': ['1'],
        'foo_mul': ['1', '2'],
    })
    self.assertEqual('1', spec_obj.get_scheduler_hint('foo_single'))
    self.assertEqual(['1', '2'], spec_obj.get_scheduler_hint('foo_mul'))
    self.assertIsNone(spec_obj.get_scheduler_hint('oops'))
    self.assertEqual('bar', spec_obj.get_scheduler_hint('oops', default='bar'))

dataset/ETHPy150Open openstack/nova/nova/tests/unit/objects/test_request_spec.py _TestRequestSpecObject.test_get_scheduler_hint/original