Skip to content

Commit

Permalink
Merge 4772f57 into 2e55570
Browse files Browse the repository at this point in the history
  • Loading branch information
datakurre authored Sep 10, 2021
2 parents 2e55570 + 4772f57 commit 75525fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/sphinxcontrib/httpexample/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def build_curl_command(request):
parts = ['curl', '-i']

# Method
if request.command != 'GET':
parts.append('-X {}'.format(request.command))
parts.append('-X {}'.format(request.command))

# URL
parts.append(shlex_quote(request.url()))
Expand Down
12 changes: 6 additions & 6 deletions tests/snapshots/snap_test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@

snapshots['test_fixture[build_httpie_command-fixture_007] 1'] = "http 'http://localhost:8080/Plone/front-page?foo=bar&bar=foo' Accept:application/json -a admin:admin"

snapshots['test_fixture[build_curl_command-fixture_001] 1'] = 'curl -i http://localhost:8080/Plone/front-page -H "Accept: application/json" --user admin:admin'
snapshots['test_fixture[build_curl_command-fixture_001] 1'] = 'curl -i -X GET http://localhost:8080/Plone/front-page -H "Accept: application/json" --user admin:admin'

snapshots['test_fixture[build_curl_command-fixture_002] 1'] = 'curl -i -X POST http://localhost:8080/Plone/folder -H "Accept: application/json" -H "Content-Type: application/json" --data-raw \'{"@type": "Document", "title": "My Document"}\' --user admin:admin'

snapshots['test_fixture[build_curl_command-fixture_003] 1'] = 'curl -i -X PATCH http://localhost:8080/Plone/folder/my-document -H "Accept: application/json" -H "Content-Type: application/json" --data-raw \'{"title": "My New Document Title"}\' --user admin:admin'

snapshots['test_fixture[build_curl_command-fixture_004] 1'] = 'curl -i http://localhost:8080/Plone/front-page -H "Accept: application/json"'
snapshots['test_fixture[build_curl_command-fixture_004] 1'] = 'curl -i -X GET http://localhost:8080/Plone/front-page -H "Accept: application/json"'

snapshots['test_fixture[build_curl_command-fixture_005] 1'] = 'curl -i http://localhost:8080/Plone/front-page -H "Accept: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"'
snapshots['test_fixture[build_curl_command-fixture_005] 1'] = 'curl -i -X GET http://localhost:8080/Plone/front-page -H "Accept: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"'

snapshots['test_fixture[build_curl_command-fixture_006] 1'] = 'curl -i -X PATCH http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f -H "Accept: application/json" -H "Content-Type: application/offset+octet-stream" -H "Tus-Resumable: 1.0.0" -H "Upload-Offset: 3" --data-raw \'defgh\' --user admin:secret'

snapshots['test_fixture[build_curl_command-fixture_007] 1'] = 'curl -i \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" --user admin:admin'
snapshots['test_fixture[build_curl_command-fixture_007] 1'] = 'curl -i -X GET \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" --user admin:admin'

snapshots['test_fixture[build_wget_command-fixture_001] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin'

Expand Down Expand Up @@ -70,7 +70,7 @@

snapshots['test_fixture[build_httpie_command-fixture_008] 1'] = 'http \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' Accept:application/json Accept-Encoding:"gzip, deflate" Cookie:"zyx 123" If-None-Match:\'"\'"abc123"\'"\' Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"'

snapshots['test_fixture[build_curl_command-fixture_008] 1'] = 'curl -i \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" -H "Accept-Encoding: gzip, deflate" -H "Cookie: zyx 123" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"'
snapshots['test_fixture[build_curl_command-fixture_008] 1'] = 'curl -i -X GET \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" -H "Accept-Encoding: gzip, deflate" -H "Cookie: zyx 123" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"'

snapshots['test_fixture[build_wget_command-fixture_008] 1'] = 'wget -S -O- \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' --header="Accept: application/json" --header="Accept-Encoding: gzip, deflate" --header="Cookie: zyx 123" --header="If-None-Match: "\'"\'"abc123"\'"\' --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"'

Expand Down Expand Up @@ -116,7 +116,7 @@

snapshots['test_fixture[build_httpie_command-fixture_011] 1'] = "http 'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc' Accept:application/json -a admin:admin"

snapshots['test_fixture[build_curl_command-fixture_011] 1'] = 'curl -i \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' -H "Accept: application/json" --user admin:admin'
snapshots['test_fixture[build_curl_command-fixture_011] 1'] = 'curl -i -X GET \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' -H "Accept: application/json" --user admin:admin'

snapshots['test_fixture[build_requests_command-fixture_011] 1'] = "requests.get('http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))"

Expand Down

0 comments on commit 75525fa

Please sign in to comment.