Exemplo n.º 1
0
    def test_post_request(self, request_path, request_body):
        """
        Tests a typical POST request, submitting some data in a body.
        """
        request_method = 'POST'
        headers = [content_length_header(request_body)]
        message = message_for_request(
            request_method, request_path, headers=headers, body=request_body)

        self.assert_valid_http_request_message(
            message, request_method, request_path,
            request_headers=headers, request_body=request_body)
Exemplo n.º 2
0
    def test_kitchen_sink(
            self, request_method, request_path, request_params, request_headers, request_body):
        """
        Throw everything at channels that we dare. The idea is that if a combination
        of method/path/headers/body would break the spec, hypothesis will eventually find it.
        """
        request_headers.append(content_length_header(request_body))
        message = message_for_request(
            request_method, request_path, request_params, request_headers, request_body)

        self.assert_valid_http_request_message(
            message, request_method, request_path, request_params, request_headers, request_body)