I'm creating test framework for my API project in python
Shortly i have a function where I
- Create user via API
- Trigger update session for him
- Im sending GET request and looking if status is completed
- If its still in progress thet repeat the get request if not go further
In response i have flat json object and i just want to look in one field 'status' from point 3)
How you reccomend to do it ?
def test_object():
createdUser = user.create() //here im sending post request to create user
returnedObject = object.get(createObject.id, createdUser.id)
assert returnedObject== createdObject
# assert returnedUpdate.status == 'success'
validate_field('success', returnedObject.status)
How to validate this field in external function and if this is not correct then run only get request without 1 line on POST Create user ?