svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 326 forks source link

Is there PATCH method compatibility? #315

Open SebaRossi94 opened 3 years ago

SebaRossi94 commented 3 years ago

Hello there, I've been configuring some testings recently and had no major issues except for when i need to test a PATCH API.

I read the issues related where it is mentioned that there is PATCH compatibility but after double and triple checking the code it seems that the entity is not updated in the db, therefore the test returns error.

This error is due tu validators and not the request itself. If i run the test script with --verbose and --log=DEBUG options i see that the method used in that specific test request is GET instead of PATCH.

So my question is if there is compatibility with PATCH method. Here it is the output:

Output:

ERROR:Test Failed: Patch update customer 1. Add name and last name URL={URl_PATH} Group=Customers HTTP Status Code: 200
ERROR:Test Failure, failure type: Validator Failed, Reason: Comparison failed, evaluating eq(None, Pyresttest_name) returned False
ERROR:Validator/Error details:Extractor: Extractor Type: jsonpath_mini,  Query: "contact.firstName", Templated?: False
Expected is templated, raw value: $customer_name
ERROR:Test Failure, failure type: Validator Failed, Reason: Comparison failed, evaluating eq(None, Pyresttest_lastname) returned False
ERROR:Validator/Error details:Extractor: Extractor Type: jsonpath_mini,  Query: "contact.lastName", Templated?: False
crazi-coder commented 3 years ago

@SebaRossi94 Yes it support in https://github.com/crazi-coder/resttest3