def METHOD_NAME(host='nds.test.gwpy', port=31200, buffers=[], protocol=2):
    import nds2
    NdsConnection = mock.create_autospec(nds2.connection)
    try:
        NdsConnection.get_parameter.return_value = False
    except AttributeError:
        # nds2-client < 0.12 doesn't have {get,set}_parameter
        pass
    NdsConnection.get_host.return_value = host
    NdsConnection.get_port.return_value = int(port)
    NdsConnection.get_protocol.return_value = int(protocol)
    def iterate(start, end, names):
        if not buffers:
            return []
        return [[b for b in buffers if
                 Channel.from_nds2(b.channel).ndsname in names]]
    NdsConnection.iterate = iterate
    def find_channels(name, ctype, dtype, *sample_rate):
        return [b.channel for b in buffers if b.channel.name == name]
    NdsConnection.find_channels = find_channels
    def get_availability(names):
        out = []
        for buff in buffers:
            name = '{0.name},{0.type}'.format(Channel.from_nds2(buff.channel))
            if name not in names:
                segs = []
            else:
                start = buff.gps_seconds + buff.gps_nanoseconds * 1e-9
                end = start + buff.sample_rate * buff.length
                segs = [(start, end)]
            out.append(nds2_availability(name, segs))
        return out
    NdsConnection.get_availability = get_availability
    return NdsConnection