# ...

    assert len(products) == 2
    assert products[0].id == 1
    assert products[0].name == "Banana"
    assert products[0].price == 0.5
    assert products[1].id == 2
    assert isinstance(products[0], Product)
    assert isinstance(products[1], Product)
```

Check that the new tests pass:

```bash
hatch run test
```

We've now added type safety to the SDK using Pydantic, ensuring that the SDK user receives a list of `Product` models when calling the `list_products()` function. The same principle can be applied to other parts of the SDK to ensure that the user receives the correct data types.

## Add Type Safety to the SDK Constructor

To ensure that the SDK user provides the correct data types when instantiating the `EComSDK` class, we can use Pydantic to create a `Config` model for the SDK constructor.

First, create a `Config` model in the `./src/ecom_sdk/models.py` file:

```python filename="src/ecom_sdk/models.py"
from pydantic import BaseModel

class Config(BaseModel):
    api_url: str
    api_key: str
```

Next, import the `Config` model into the `./src/ecom_sdk/sdk.py` file:

```python filename="src/ecom_sdk/sdk.py"
from .models import Config
```

Now, modify the `EComSDK` class to accept a `Config` model in the constructor:

```python filename="src/ecom_sdk/sdk.py"