#NEWLINE# def test_consume_VF_and_PF_requests( self ) : #NEWLINE# #INDENT# with test . nested ( mock . patch . object ( objects . PciDevice , 'get_by_dev_addr' , side_effect = self . _fake_pci_device_get_by_addr ) , mock . patch . object ( objects . PciDeviceList , 'get_by_parent_address' , side_effect = self . _fake_get_by_parent_address ) ) : #NEWLINE# #INDENT# self . _create_pci_devices ( ) #NEWLINE# pci_requests = [ objects . InstancePCIRequest ( count = 2 , spec = [ { #NEWLINE# #INDENT# 'product_id' : '1515' , #NEWLINE# #UNINDENT# } ] ) , objects . InstancePCIRequest ( count = 1 , spec = [ { #NEWLINE# #INDENT# 'product_id' : '1528' , #NEWLINE# 'dev_type' : 'type-PF' , #NEWLINE# #UNINDENT# } ] ) ] #NEWLINE# devs = self . pci_stats . consume_requests ( pci_requests ) #NEWLINE# self . assertEqual ( 3 , len ( self ) ) #NEWLINE# self . assertEqual ( set ( [ '1528' , '1515' ] ) , set ( [ dev . product_id for dev in devs ] ) )