code: def test_view_decorators(app, client):
      def add_x_parachute(f):
          def new_function(*args, **kwargs):
              resp = flask.make_response(f(*args, **kwargs))
              resp.headers["X-Parachute"] = "awesome"
              return resp
  
          return new_function
  
      class Index(flask.views.View):
          decorators = [add_x_parachute]
  
          def dispatch_request(self):
              return "Awesome"
  
      app.add_url_rule("/", view_func=Index.as_view("index"))
      rv = client.get("/")
      assert rv.headers["X-Parachute"] == "awesome"
      assert rv.data == b"Awesome"
  
file_path: flask/tests/test_views.py
imports: import pytest
  from werkzeug.http import parse_set_header
  import flask.views
label_desc: Use image node_id 6 for calling a global function with example usage: test_view_decorators(app, client) and returns: new_function, resp, str