def test_physical_function(self, *args): with mock.patch.object(builtins, 'open', mock.mock_open(read_data='4')): self.assertTrue(utils.is_physical_function(*self.pci_args))
def test_exception(self, *args): self.assertFalse(utils.is_physical_function(*self.pci_args))
def test_virtual_function(self, *args): with mock.patch.object(builtins, 'open', side_effect=IOError()): self.assertFalse(utils.is_physical_function(*self.pci_args))
def _check_physical_function(self): if self.pci_address_spec.is_single_address(): self.is_physical_function = (utils.is_physical_function( self.pci_address_spec.domain, self.pci_address_spec.bus, self.pci_address_spec.slot, self.pci_address_spec.func))
def test_exception(self, *args): self.assertFalse(utils.is_physical_function(*self.pci_args))
def test_physical_function(self, *args): with mock.patch.object(builtins, 'open', mock.mock_open(read_data='4')): self.assertTrue(utils.is_physical_function(*self.pci_args))
def test_virtual_function(self, *args): with mock.patch.object(builtins, 'open', side_effect=IOError()): self.assertFalse(utils.is_physical_function(*self.pci_args))