I have a pytest script making HTTP calls. One of the calls returns a response like this:
{"success":[],"error":[{"hpsId":10037,"powerPlant":{"name":"xxx","id":16606,"regionId":20,"priceArea":2,"timeSeries":null,"units":[]}}]}
The script looks like this:
def test_bid_submission_send():
# Act:
response = post_requests(token, '/xxx/api/xxx/bidsubmissions/send',
setpayload_bidsubmissions_send(powerplantId))
and the response is like the mentioned.
I want to fail the test_bid_submission if the error [] has content (then the success [] will have content).
How can I obtain that?
1