'Mock for L{socket.getaddrinfo}.
@param host: see L{socket.getaddrinfo}
@param port: see L{socket.getaddrinfo}
@param family: see L{socket.getaddrinfo}
@param socktype: see L{socket.getaddrinfo}
@param proto: see L{socket.getaddrinfo}
@param flags: see L{socket.getaddrinfo}
@return: L{socket.getaddrinfo}'

def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0):

    self.calls.append((host, port, family, socktype, proto, flags))
    results = self.results[host]
    if results:
        return results
    else:
        raise gaierror(EAI_NONAME, 'nodename    nor    servname    provided,    or    not    known')
