[WorkOrders] Test Setup (Mock) #170

Closed
opened 2025-12-12 17:06:43 +00:00 by GFMpt13 · 0 comments
GFMpt13 commented 2025-12-12 17:06:43 +00:00 (Migrated from github.com)
  • Create tests/test_routes/test_work_orders.py.

  • Configure AsyncMock for WorkOrderRepo.

  • Test Create:

    • test_create_work_order_success (201 Created).
    • test_create_work_order_active_exists (Mock repo raising ActiveWorkOrderExistsError, expect 409).
  • Test Read:

    • test_get_work_order_by_id_success (200 OK).
    • test_get_work_order_by_number_success (200 OK).
    • test_get_work_order_not_found (404 Not Found).
  • Test Filters:

    • test_list_work_orders_by_vehicle (Mock get_by_vehicle_id).
    • test_list_work_orders_by_client (Mock get_by_client_id).
  • Test Update: test_update_work_order_status

  • Test Delete: test_delete_work_order_success.

- [x] Create tests/test_routes/test_work_orders.py. - [x] Configure AsyncMock for WorkOrderRepo. - [x] Test Create: - [x] test_create_work_order_success (201 Created). - [x] test_create_work_order_active_exists (Mock repo raising ActiveWorkOrderExistsError, expect 409). - [x] Test Read: - [x] test_get_work_order_by_id_success (200 OK). - [x] test_get_work_order_by_number_success (200 OK). - [x] test_get_work_order_not_found (404 Not Found). - [x] Test Filters: - [x] test_list_work_orders_by_vehicle (Mock get_by_vehicle_id). - [x] test_list_work_orders_by_client (Mock get_by_client_id). - [x] Test Update: test_update_work_order_status - [x] Test Delete: test_delete_work_order_success.
Sign in to join this conversation.
No description provided.