#NEWLINE# def test_create_with_extras( self ) : #NEWLINE# #INDENT# inst = objects . Instance ( context = self . context , uuid = self . fake_instance [ 'uuid' ] , numa_topology = test_instance_numa_topology . fake_obj_numa_topology , pci_requests = objects . InstancePCIRequests ( requests = [ objects . InstancePCIRequest ( count = 123 , spec = [ ] ) ] ) , vcpu_model = test_vcpu_model . fake_vcpumodel ) #NEWLINE# inst . create ( ) #NEWLINE# self . assertIsNotNone ( inst . numa_topology ) #NEWLINE# self . assertIsNotNone ( inst . pci_requests ) #NEWLINE# self . assertEqual ( 1 , len ( inst . pci_requests . requests ) ) #NEWLINE# self . assertIsNotNone ( inst . vcpu_model ) #NEWLINE# got_numa_topo = objects . InstanceNUMATopology . get_by_instance_uuid ( self . context , inst . uuid ) #NEWLINE# self . assertEqual ( inst . numa_topology . instance_uuid , got_numa_topo . instance_uuid ) #NEWLINE# got_pci_requests = objects . InstancePCIRequests . get_by_instance_uuid ( self . context , got_numa_topo . uuid ) #NEWLINE# self . assertEqual ( 123 , got_pci_requests . requests [ 0 ] . count ) #NEWLINE# vcpu_model = objects . VirtCPUModel . get_by_instance_uuid ( self . context , inst . uuid ) #NEWLINE# self . assertEqual ( 'fake-model' , vcpu_model . model )