

def test_to_legacy_instance(self):
    spec = objects.RequestSpec()
    spec.flavor = objects.Flavor(root_gb=10, ephemeral_gb=0, memory_mb=10, vcpus=1)
    spec.numa_topology = None
    spec.pci_requests = None
    spec.project_id = fakes.FAKE_PROJECT_ID
    self.availability_zone = 'nova'
    instance = spec._to_legacy_instance()
    self.assertEqual({
        'root_gb': 10,
        'ephemeral_gb': 0,
        'memory_mb': 10,
        'vcpus': 1,
        'numa_topology': None,
        'pci_requests': None,
        'project_id': fakes.FAKE_PROJECT_ID,
        'availability_zone': 'nova',
    }, instance)

dataset/ETHPy150Open openstack/nova/nova/tests/unit/objects/test_request_spec.py _TestRequestSpecObject.test_to_legacy_instance/VarMisuse@63/80 `spec`->`self`