input: Write a function to implement a basic CRUD API for the BlogPost model using Python and Flask. The API should include endpoints for creating a post, getting all posts, getting a single post, editing a post, and deleting a post. The function should return the Flask application object.
  
  assert app.test_client().post('/post', json={'title': 'Test Post', 'content': 'This is a test post'}).status_code == 200
  assert app.test_client().get('/posts').status_code == 200
  assert app.test_client().get('/post/1').status_code == 200
  assert app.test_client().put('/post/1', json={'title': 'Updated Post', 'content': 'This post has been updated'}).status_code == 200
  assert app.test_client().delete('/post/1').status_code == 200
output: 
  def create_blog_api():
      from flask import Flask, request, jsonify
  
      app = Flask(__name__)
      posts = []
  
      @app.route('/post', methods=['POST'])
      def create_post():
          data = request.json
          post = {'id': len(posts) + 1, 'title': data['title'], 'content': data['content']}
          posts.append(post)
          return jsonify(post)
  
      @app.route('/posts', methods=['GET'])
      def get_posts():
          return jsonify(posts)
  
      @app.route('/post/<int:post_id>', methods=['GET'])
      def get_post(post_id):
          post = next((p for p in posts if p['id'] == post_id), None)
          if post:
              return jsonify(post)
          return jsonify({'error': 'Post not found'}), 404
  
      @app.route('/post/<int:post_id>', methods=['PUT'])
      def edit_post(post_id):
          data = request.json
          post = next((p for p in posts if p['id'] == post_id), None)
          if post:
              post['title'] = data.get('title', post['title'])
              post['content'] = data.get('content', post['content'])
              return jsonify(post)
          return jsonify({'error': 'Post not found'}), 404
  
      @app.route('/post/<int:post_id>', methods=['DELETE'])
      def delete_post(post_id):
          global posts
          posts = [p for p in posts if p['id'] != post_id]
          return jsonify({'result': 'Post deleted'})
  
      return app
  