This pull request includes changes to the following files:
server/app/tests/test_api.py
server/app/utils/validators.py
Summary
In test_api.py, added a check to verify if the asset is marked as sold in both the database and response data.
In test_api.py, added two new test cases to validate the purchase request with an invalid asset ID and an invalid buyer address.
In test_api.py, added a new test case to validate the purchase request for an already sold asset.
In validators.py, modified the is_valid_asset_id function to also check if the asset ID exists in the database.
In validators.py, modified the is_valid_address function to return an error message if the blockchain address format is invalid.
In validators.py, modified the validate_purchase_request function to return an error message if the asset ID is not available.
Fixes #15.
π Latest improvements to Sweep:
We just released a dashboard to track Sweep's progress on your issue in real-time, showing every stage of the process β from search to planning and coding.
Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
PR Feedback (click)
Description
This pull request includes changes to the following files:
Summary
test_api.py
, added a check to verify if the asset is marked as sold in both the database and response data.test_api.py
, added two new test cases to validate the purchase request with an invalid asset ID and an invalid buyer address.test_api.py
, added a new test case to validate the purchase request for an already sold asset.validators.py
, modified theis_valid_asset_id
function to also check if the asset ID exists in the database.validators.py
, modified theis_valid_address
function to return an error message if the blockchain address format is invalid.validators.py
, modified thevalidate_purchase_request
function to return an error message if the asset ID is not available.Fixes #15.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: