'Tests to make sure we use the alternative name in errors.'

def test_detach_device_with_retry_device_not_found_alt_name(self):

    get_config = mock.Mock(return_value=None)
    self.domain.isPersistent.return_value = True
    ex = self.assertRaises(exception.DeviceNotFound, self.guest.detach_device_with_retry, get_config, mock.sentinel.device, live=True, alternative_device_name='foo')
    self.assertIn('foo', six.text_type(ex))
