'Test `available` attribute when `libc` has no `splice` support'

def test_unavailable_in_libc(self):

    class LibC(object, ):
        'A    fake    `libc`    object    tracking    `splice`    attribute    access'
        def __init__(self):
            self.splice_retrieved = False
        @property
        def splice(self):
            self.splice_retrieved = True
            raise AttributeError
    libc = LibC()
    mock_cdll = mock.Mock(return_value=libc)
    with mock.patch('ctypes.CDLL', new=mock_cdll):
        new_splice = type(splice)()
        self.assertFalse(new_splice.available)
    libc_name = ctypes.util.find_library('c')
    mock_cdll.assert_called_once_with(libc_name, use_errno=True)
    self.assertTrue(libc.splice_retrieved)
