To solve this optimization problem, we first need to define the variables and the objective function. Let's denote the number of units of cherry tomatoes as `x` and the number of units of cocktail tomatoes as `y`. The objective is to minimize the total cost, which can be represented as `3x + 4y`, since cherry tomatoes cost $3 per unit and cocktail tomatoes cost $4 per unit.

The constraints are based on the requirements for sugar and acid content in the tomato paste:
1. Sugar constraint: `5x + 2.5y >= 350` (since cherry tomatoes contain 5 grams of sugar per unit and cocktail tomatoes contain 2.5 grams of sugar per unit, and we need at least 350 grams of sugar).
2. Acid constraint: `1.5x + 3y >= 250` (since cherry tomatoes contain 1.5 grams of acid per unit and cocktail tomatoes contain 3 grams of acid per unit, and we need at least 250 grams of acid).

Additionally, the number of units of each type of tomato cannot be negative:
3. Non-negativity constraints: `x >= 0` and `y >= 0`.

Now, let's write the Gurobi code in Python to solve this linear programming problem:

```python
from gurobipy import *

# Create a new model
m = Model("Tomato_Paste_Optimization")

# Define variables
x = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="cherry_tomatoes")
y = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="cocktail_tomatoes")

# Set the objective function
m.setObjective(3*x + 4*y, GRB.MINIMIZE)

# Add constraints
m.addConstr(5*x + 2.5*y >= 350, "sugar_constraint")
m.addConstr(1.5*x + 3*y >= 250, "acid_constraint")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Cherry tomatoes: {x.x}")
    print(f"Cocktail tomatoes: {y.x}")
    print(f"Minimum cost: ${m.objVal:.2f}")
else:
    print("No optimal solution found.")

```