mirror of
https://github.com/httpie/cli.git
synced 2026-06-20 11:32:56 +02:00
Fix printing redirected prepared request in verbose mode (#1088)
This commit is contained in:
1 parent
1470ca0c77
commit
2d55c01c7e
2 files changed
+20
-3
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import pytest
|
||||
|
||||
from httpie.status import ExitStatus
|
||||
from .fixtures import FILE_PATH_ARG
|
||||
from .utils import http, HTTP_OK
|
||||
|
||||
|
||||
@@ -57,3 +58,19 @@ def test_max_redirects(httpbin):
|
||||
tolerate_error_exit_status=True,
|
||||
)
|
||||
assert r.exit_status == ExitStatus.ERROR_TOO_MANY_REDIRECTS
|
||||
|
||||
|
||||
def test_http_307_allow_redirect_post(httpbin):
|
||||
r = http('--follow', 'POST', httpbin.url + '/redirect-to',
|
||||
f'url=={httpbin.url}/post', 'status_code==307',
|
||||
'@' + FILE_PATH_ARG)
|
||||
assert HTTP_OK in r
|
||||
|
||||
|
||||
def test_http_307_allow_redirect_post_verbose(httpbin):
|
||||
r = http('--follow', '--verbose', 'POST', httpbin.url + '/redirect-to',
|
||||
f'url=={httpbin.url}/post', 'status_code==307',
|
||||
'@' + FILE_PATH_ARG)
|
||||
assert r.count('POST /redirect-to') == 1
|
||||
assert r.count('POST /post') == 1
|
||||
assert HTTP_OK in r
|
||||
Reference in new issue
Block a user