kghalamb / AirStage

0 stars 0 forks source link

Test results Gibson Hooper #7

Open gibsonhooper25 opened 11 months ago

gibsonhooper25 commented 11 months ago

Given Workflows

Example Workflow: Performer Booking a Venue

  1. curl -X 'GET' 'https://airstage-api.onrender.com/catalog/venues/' -H 'accept: application/json'
  2. [{"venue_id":1,"name":"Outside Lands","location":"San Francisco","capacity":10000,"price":50000,"time_available":"2023-10-28T00:00:00+00:00","time_end":"2023-10-28T03:00:00+00:00"}]
  3. curl -X 'POST' 'https://airstage-api.onrender.com/book/create/request_venue/1' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"venue_id":1,"name":"Outside Lands","location":"San Francisco","capacity":10000,"price":50000,"time_available":"2023-10-28T00:00:00+00:00","time_end":"2023-10-28T03:00:00+00:00"}'
  4. {"success":false} I'm assuming this was intended to return true, but it returned false because the available time slot for the performer and venue do not match. Guessing the database has been changed since the example workflow was created and tested.

Signup/Signin

  1. curl -X 'POST' 'https://airstage-api.onrender.com/user/signup/' -H 'accept: application/json' -H 'Co ntent-Type: application/json' -d '{"username": "taylorswiftismid", "password": "test123", "user_type": "performer"}'
  2. {"success":true}
  3. curl -X 'POST' 'https://airstage-api.onrender.com/user/signin/' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"username": "taylorswiftismid", "password": "test123", "user_type": "performer"}'
  4. {"success":true}

View/Modify Booking

  1. curl -X 'GET' 'https://airstage-api.onrender.com/book/3' -H 'accept: application/json'

  2. {"detail":"Not Found"} Guessing the API has been changed since the example workflows were created. Appears that this is now done with:

  3. curl -X 'GET' 'https://airstage-api.onrender.com/catalog/booking/3' -H 'accept: application/json'

  4. {"venue_id":1,"performer_id":1,"time_start":"2023-11-06T22:00:00+00:00","time_end":"2023-11-07T00:00:00+00:00"}

  5. curl -X 'POST' 'https://airstage-api.onrender.com/book/bookings/edit/3' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"venue_id":1,"performer_id":1,"time_start":"2023-11-04T22:00:00+00:00","time_end":"2023-11-07T00:00:00+00:00"}'

  6. {"success":true}

Other Workflows

Create Venue, book a performer, and try modifying the booking to a time that they are not available

  1. curl -X 'POST' 'https://airstage-api.onrender.com/user/signup/' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"username": "levis_stadium", "password": "test456", "user_type": "venue"}'

  2. Internal Server Error - I can't create a venue. My guess is you made the user_id have to be unique in supabase, and the duplicate :d parameter binding on line 45 in user.py is trying to create another venue with user_id 10000, which is causing an error. Going to use the existing venue for the rest of this test workflow.

  3. curl -X 'POST' 'https://airstage-api.onrender.com/book/create/request_performer/1' -H 'accept: appli cation/json' -H 'Content-Type: application/json' -d '{ "performer_id": 3, "name": "taylorswiftismid", "capacity_preference": 10000, "price": 10000, "time_available": "2023-11-13T04:50:08.008782+00:00", "time_end": "2023-11-13T04:50:08.008782+00:00" }'

  4. {"success":true} - created booking 5, {"venue_id":1,"performer_id":3,"time_start":"2023-10-28T00:00:00+00:00","time_end":"2023-10-28T03:00:00+00:00"}. Pretty sure this is not good, because performer_id 3's time_available and time_end do not fall within the time_start and time_end given.

  5. curl -X 'POST' 'https://airstage-api.onrender.com/book/bookings/edit/5' -H 'accept: application/json ' -H 'Content-Type:application/json' -d '{"venue_id":1,"performer_id":3,"time_start":"2023-11-04T22:00:00+00:00","time_end":"2023-11-07T00:00:00+00:00"}'

  6. {"success":true} - I think this should have failed because performer's time available is not open for the given booking time slot. { "performer_id": 3, "name": "taylorswiftismid", "capacity_preference": 10000, "price": 10000, "time_available": "2023-11-13T04:50:08.008782+00:00", "time_end": "2023-11-13T04:50:08.008782+00:00" } (also not sure why time_available and time_end are timestamps of when I created the account)

Get booking and delete it. Then try to delete it again

  1. curl -X 'GET' 'https://airstage-api.onrender.com/catalog/booking/5' -H 'accept: application/json'
  2. {"venue_id":1,"performer_id":3,"time_start":"2023-11-04T22:00:00+00:00","time_end":"2023-11-07T00:00:00+00:00"}
  3. curl -X 'POST' 'https://airstage-api.onrender.com/book/bookings/cancel/5' -H 'accept: application/json' -H 'Content-Type: application/json'
  4. {"success":true}
  5. curl -X 'POST' 'https://airstage-api.onrender.com/book/bookings/cancel/5' -H 'accept: application/json' -H 'Content-Type: application/json'
  6. {"success":false}

Try creating a booking for a performer that does not exist, and for performer with incorrect performer payload.

  1. curl -X 'POST' 'https://airstage-api.onrender.com/book/create/request_performer/1' -H 'accept: appli cation/json' -H 'Content-Type: application/json' -d '{ "performer_id": 77, "name": "taylorswiftismid", "capacity_preference": 100000, "price": 50000, "time_available": "2023-11-13T04:50:08.008782+00:00", "time_end": "2023-11-13T04:50:08.008782+00:00" }'
  2. Internal Server Error - would prefer real error message
  3. curl -X 'POST' 'https://airstage-api.onrender.com/book/create/request_performer/1' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{ "performer_id": 3, "name": "taylorswiftistrash", "capacity_preference": 100000, "price": 50000, "time_available": "2023-11-13T04:50:08.008782+00:00", "time_end": "2023-11-13T04:50:08.008782+00:00" }'
  4. {"success":true} - probably should check that the performer payload besides the id is correct, otherwise anyone can make this call.