input: Write a function to test the BlogPost CRUD API using the requests module in Python. The function should accept an API URL as an argument and perform operations to create, get, update, and delete a blog post. The function should return True if all operations are successful, otherwise return False.
  assert test_crud_api("http://127.0.0.1:5000")==True
output: def test_crud_api(api_url):
      import requests
      import json
  
      # Create a new blog post
      new_post = {
          "title": "Test Post",
          "content": "This is a test post."
      }
      response = requests.post(f"{api_url}/posts", json=new_post)
      if response.status_code != 201:
          return False
      post_id = response.json().get("id")
  
      # Get the created blog post
      response = requests.get(f"{api_url}/posts/{post_id}")
      if response.status_code != 200:
          return False
  
      # Update the blog post
      updated_post = {
          "title": "Updated Test Post",
          "content": "This is an updated test post."
      }
      response = requests.put(f"{api_url}/posts/{post_id}", json=updated_post)
      if response.status_code != 200:
          return False
  
      # Delete the blog post
      response = requests.delete(f"{api_url}/posts/{post_id}")
      if response.status_code != 204:
          return False
  
      return True