def register_response(self, command, kwargs, response):
        """
        Register a response to a L{callRemote} command.

        @param commandType: a subclass of C{amp.Command}.

        @param kwargs: Keyword arguments taken by the command, a C{dict}.

        @param response: The response to the command.
        """
        if isinstance(response, Exception):
            response = Failure(response)
        else:
            try:
                command.makeResponse(response, AMP())
            except __HOLE__:
                raise InvalidSignature("Bad registered response")
        self._responses[self._makeKey(command, kwargs)] = response
dataset/ETHPy150Open ClusterHQ/flocker/flocker/testtools/amp.py/FakeAMPClient.register_response