input: Write a Python function to import data from a CSV file and train a linear regression model using scikit-learn to predict prices based on size, location, and number of bedrooms. Use pandas for data manipulation and sklearn for the model. Include tests for the function using assert statements.
  assert predict_price('data.csv', [[1500, 'downtown', 3]]) == [expected_value]
  assert predict_price('data.csv', [[2000, 'suburbs', 4]]) == [expected_value]
  assert predict_price('data.csv', [[1200, 'downtown', 2]]) == [expected_value]
output: import pandas as pd
  from sklearn.linear_model import LinearRegression
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.compose import ColumnTransformer
  from sklearn.pipeline import Pipeline
  import numpy as np
  
  def predict_price(csv_file, features):
      # Load data
      data = pd.read_csv(csv_file)
      
      # Define feature columns and target
      X = data[['size', 'location', 'bedrooms']]
      y = data['price']
      
      # Create preprocessing pipeline
      preprocessor = ColumnTransformer(
          transformers=[
              ('num', 'passthrough', ['size', 'bedrooms']),
              ('cat', OneHotEncoder(), ['location'])
          ])
      
      # Create a pipeline
      model = Pipeline(steps=[
          ('preprocessor', preprocessor),
          ('regressor', LinearRegression())
      ])
      
      # Fit the model
      model.fit(X, y)
      
      # Predict prices
      predictions = model.predict(features)
      
      return predictions.tolist()