Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PATCH method to pycurl request #129

Merged
merged 1 commit into from Dec 16, 2015
Merged

Conversation

lerrua
Copy link
Contributor

@lerrua lerrua commented Dec 15, 2015

Hi @svanoort

Thanks again for the great job with pyresttest and sorry for my poor english.
Anyway, this Pull Requests can solve #117 issue, now PATCH is really implement.

Please, check this example:

- test:
  - name: "Update an user from Contribution Details as admin"
  - url: "/contribution_details?id=eq.1"
  - headers: {'Content-Type': 'application/json'}
  - method: "PATCH"
  - body: '{"user_id": 2}'
  - expected_status: [204]

It's ours public API specs (you can check here https://github.com/catarse/catarse-api-specs) and running tests i've got this following error

test/contribution_details.yml...
{"message":"Failed to parse JSON payload. not enough input"}
[('transfer-encoding', 'chunked'), ('date', 'Tue, 15 Dec 2015 21:13:46 GMT'), ('server', 'postgrest/0.2.12.0'), ('content-type', 'application/json')]
ERROR:Test Failed: Update an user from Contribution Details as admin URL=http://localhost:8888/contribution_details?id=eq.1 Group=Default HTTP Status Code: 400
ERROR:Test Failure, failure type: Invalid HTTP Response Code, Reason: Invalid HTTP response code: response code 400 not in expected codes [[204]]
Test Group Default FAILED: 2/3 Tests Passed!

With this PR now this example works fine

test/contribution_details.yml...
Test Group Default SUCCEEDED: 3/3 Tests Passed!

Hope you like it 馃嵒

@svanoort-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@svanoort
Copy link
Owner

@svanoort-jenkins jenkins test

@svanoort svanoort added this to the 1.7.0 - Python 3 + Parsing/Configuration Internals milestone Dec 16, 2015
@svanoort svanoort merged commit fdbbc38 into svanoort:master Dec 16, 2015
@svanoort
Copy link
Owner

馃嵒 indeed, thank you!

I added back in part of the testing that wasn't working earlier for PATCH (I assumed it was server-specific, looks like not). Also, added changelog notes for this.

Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants