Esempio n. 1
0
    def test_default_content_type(self, req, includes):
        del req["headers"]["Content-Type"]

        args = get_request_args(req, includes)

        assert args["headers"]["content-type"] == "application/json"
Esempio n. 2
0
    def test_file_and_data_fails(self, req, includes):
        """Can't send json/form data and files at once"""
        req["files"] = ["abc"]

        with pytest.raises(exceptions.BadSchemaError):
            get_request_args(req, includes)
Esempio n. 3
0
    def test_no_override_method(self, req, includes):
        req["method"] = "POST"

        args = get_request_args(req, includes)

        assert args["method"] == "POST"
Esempio n. 4
0
    def test_array_substitution(self, req, includes):
        args = get_request_args(req, includes)

        assert args['data']['array'] == ['def456', 'def456']