gpsandhu23 / TARS

Personal AI helper
0 stars 0 forks source link

Add unittests for API endpoint #50

Closed gpsandhu23 closed 5 months ago

gpsandhu23 commented 5 months ago

Adds unit tests for the API endpoints in api_test.py to ensure correctness and reliability of the API in various scenarios.


For more details, open the Copilot Workspace session.

sweep-ai[bot] commented 5 months ago

Sweep: PR Review

TARS/tests/surfaces/API/api_test.py

The changes add a new test suite for the /chat endpoint of the FastAPI application, including tests for successful responses, invalid input handling, and error handling.

Sweep Found These Issues

  • The unittest.mock.patch.object is used without importing unittest.mock, which will cause a NameError.
  • https://github.com/gpsandhu23/TARS/blob/e718df7f075a1bbd983270ebc8a41d711b23b9e2/TARS%2Ftests%2Fsurfaces%2FAPI%2Fapi_test.py#L20-L24 [View Diff](https://github.com/gpsandhu23/TARS/pull/50/files#diff-770678a4c4ef1f405e6ec1601d7e1e492a5dca9f4a2b17eb976eec30ec46543eR20-R24)