lumapps / lumRest

Appengine endpoint tester
Other
4 stars 1 forks source link

Check and compare objects value with check_result #14

Open despatates opened 9 years ago

despatates commented 9 years ago

With check_result option, we can check primitive values and list values. It would be great to compare objects. Example:

- my.endpoint:
  save_result: myObject
  check_result: myObject == myOtherObject

And more :

- my.endpoint:
  save_result: myObject
  check_result:
    - myObject.attribute: myOtherObject.attribute
    - myObject.id: myOtherObject.id
    - myObject.attr: "#r#[a-z]+"

Thanks LumRest team :smile:

despatates commented 7 years ago

Second example is already possible:

- my.endpoint:
  save_result: myObject
  check_result: {
    attribute: !expr myOtherObject.attribute, 
    id: !expr myOtherObject.id,
    attr: "#r#[a-z]+"
  }