Exemplo n.º 1
0
    def construct_client(self, host, metadata):
        """Construct a Client request using the provided metadata to the provided host.

        Args:
            host (str): Host to direct client request to.

        Returns:
            Transaction.Client: Constructed Client request.
        """
        request = self.client._clone()
        request.host = host
        request.path = self.client.random_uri()
        request.store(self.client.metadata.transform(metadata), self.client.metadata.terminator)
        return request
Exemplo n.º 2
0
    def construct_client(self, host, id, output):
        """Construct a Client request using the provided id and output to the provided host.

        Args:
            host (str): Host to direct client request to.
            id (str): id to include in the request.
            output (str): output to include in the request.

        Returns:
            Transaction.Client: Constructed Client request.
        """
        request = self.client._clone()
        request.host = host
        request.path = self.client.random_uri()
        request.store(self.client.id.transform(id), self.client.id.terminator)
        request.store(self.client.output.transform(output), self.client.output.terminator)
        return request