# from unittest import mock
# from app.dao.dbtransactions import DBTransactions
# from tests.conftest import client

# def test_fetch_all_delivery(mocker, mock_pull_deliveries) -> None:
#     mocker.patch("psycopg2.connect").return_value.cursor.return_value.fetchall.return_value = mock_pull_deliveries
#     response = client.get("/deliveries")
#     actual = response.json()[0]
#     expected = {"delivery_id": 0, "route_id": 1, "delivery_type": 0, "delivery_status": 1, "item_name": "test item", "quantity": 5, "client_phone": "1234567890", "client_first_name": "John", "client_last_name": "Doe", "notes": "No comments"}
#     assert response.status_code == 200
#     assert isinstance(actual, dict)
#     assert actual == expected


# def test_fetch_one_delivery() -> None:
#     response = client.get("/deliveries/0")
#     actual = response.json()
#     expected = {"delivery_id": 0, "route_id": 1, "delivery_type": 0, "delivery_status": 1, "item_name": "test item", "quantity": 5, "client_phone": "1234567890", "client_first_name": "John", "client_last_name": "Doe", "notes": "No comments"}
#     assert response.status_code == 200
#     assert isinstance(actual, dict)
#     assert actual == expected


# def test_fetch_one_delivery_does_not_exist() -> None:
#     response = client.get("/deliveries/1")
#     assert response.status_code == 404

# def test_create_delivery(mocker) -> None:
#   mocker.patch("app.dao.dbtransactions.DBTransactions.add_data").return_value = None
#   response = client.post("/deliveries", json = {"delivery_id": 0, "route_id": 1, "delivery_type": 0, "delivery_status": 1, "item_name": "test item", "quantity": 5, "client_phone": "1234567890", "client_first_name": "John", "client_last_name": "Doe", "notes": "No comments"})
#   assert response.status_code == 201

# def test_update_delivery() -> None:
#     response = client.put("/deliveries/0", json = {"delivery_id": 0, "route_id": 1, "delivery_type": 0, "delivery_status": 3, "item_name": "test item", "quantity": 5, "client_phone": "1234567890", "client_first_name": "John", "client_last_name": "Doe", "notes": "No comments"})
#     assert response.status_code == 202

# def test_delete_delivery() -> None:
#   response = client.delete("/deliveries/0")
#   assert response.status_code == 200