#NEWLINE# def test_get_by_instance_uuid( self ) : #NEWLINE# #INDENT# ctxt = context . get_admin_context ( ) #NEWLINE# fake_db_1 = dict ( fake_db_dev , address = 'a1' , status = fields . PciDeviceStatus . ALLOCATED , instance_uuid = '1' ) #NEWLINE# fake_db_2 = dict ( fake_db_dev , address = 'a2' , status = fields . PciDeviceStatus . ALLOCATED , instance_uuid = '1' ) #NEWLINE# self . mox . StubOutWithMock ( db , 'pci_device_get_all_by_instance_uuid' ) #NEWLINE# db . pci_device_get_all_by_instance_uuid ( ctxt , '1' ) . AndReturn ( [ fake_db_1 , fake_db_2 ] ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# devs = pci_device . PciDeviceList . get_by_instance_uuid ( ctxt , '1' ) #NEWLINE# self . assertEqual ( len ( fake_db_1 ) , 2 ) #NEWLINE# for i in range ( len ( fake_pci_devs ) ) : #NEWLINE# #INDENT# self . assertIsInstance ( devs [ i ] , pci_device . PciDevice ) #NEWLINE# #UNINDENT# self . assertEqual ( devs [ 0 ] . vendor_id , 'v' ) #NEWLINE# self . assertEqual ( devs [ 1 ] . vendor_id , 'v' )