'Test handling of file-descriptors'

@mock.patch.object(splice, '_c_splice')
def test_fileno(self, mock_splice):

    splice(1, None, 2, None, 3, 0)
    self.assertEqual(mock_splice.call_args, ((1, None, 2, None, 3, 0), {}))
    mock_splice.reset_mock()
    with open('/dev/zero', 'r') as fd:
        splice(fd, None, fd, None, 3, 0)
        self.assertEqual(mock_splice.call_args, ((fd.fileno(), None, fd.fileno(), None, 3, 0), {}))
