

def test_from_instance_with_numa_stuff(self):
    instance = dict(uuid=uuidutils.generate_uuid(), root_gb=10, ephemeral_gb=0, memory_mb=10, vcpus=1, project_id=fakes.FAKE_PROJECT_ID, availability_zone='nova', pci_requests=None, numa_topology={
        'cells': [{
            'id': 1,
            'cpuset': ['1'],
            'memory': 8192,
            'pagesize': None,
            'cpu_topology': None,
            'cpu_pinning_raw': None,
        }],
    })
    spec = objects.RequestSpec()
    spec._from_instance(instance)
    self.assertIsInstance(spec.numa_topology, objects.InstanceNUMATopology)
    cells = spec.numa_topology.cells
    self.assertEqual(1, len(cells))
    self.assertIsInstance(cells[0], objects.InstanceNUMACell)

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