these functions are not needed I think. You can have a side effect in Mock with:

    self.fake_sock.getaddrinfo = Mock(side_effect=socket.gaierror)