mirror of
https://github.com/httpie/cli.git
synced 2024-11-22 15:53:13 +01:00
Cleanup
This commit is contained in:
parent
e18b609ef7
commit
5408fb0fb9
@ -13,7 +13,7 @@ This project adheres to `Semantic Versioning <http://semver.org/>`_.
|
||||
* Added ``--max-redirects`` (default 30)
|
||||
* Added ``-A`` as short name for ``--auth-type``
|
||||
* Added ``-F`` as short name for ``--follow``
|
||||
* Changed the default color style back to``solarized`` as it supports
|
||||
* Changed the default color style back to ``solarized`` as it supports
|
||||
both the light and dark terminal background mode
|
||||
* Fixed ``--session`` when used with ``--download``
|
||||
* Fixed handling of ``Content-Type`` with multiple ``+subtype`` parts
|
||||
|
@ -3,20 +3,20 @@ from httpie import ExitStatus
|
||||
from utils import http, HTTP_OK
|
||||
|
||||
|
||||
class TestRedirects:
|
||||
def test_follow_no_show_redirects(httpbin):
|
||||
r = http('--follow', httpbin.url + '/redirect/2')
|
||||
assert r.count('HTTP/1.1') == 1
|
||||
assert HTTP_OK in r
|
||||
|
||||
def test_follow_no_show_redirects(self, httpbin):
|
||||
r = http('--follow', httpbin.url + '/redirect/2')
|
||||
assert r.count('HTTP/1.1') == 1
|
||||
assert HTTP_OK in r
|
||||
|
||||
def test_follow_show_redirects(self, httpbin):
|
||||
r = http('--follow', '--show-redirects', httpbin.url + '/redirect/2')
|
||||
assert r.count('HTTP/1.1') == 3
|
||||
assert r.count('HTTP/1.1 302 FOUND', 2)
|
||||
assert HTTP_OK in r
|
||||
def test_follow_show_redirects(httpbin):
|
||||
r = http('--follow', '--show-redirects', httpbin.url + '/redirect/2')
|
||||
assert r.count('HTTP/1.1') == 3
|
||||
assert r.count('HTTP/1.1 302 FOUND', 2)
|
||||
assert HTTP_OK in r
|
||||
|
||||
def test_max_redirects(self, httpbin):
|
||||
r = http('--max-redirects=1', '--follow', httpbin.url + '/redirect/3',
|
||||
error_exit_ok=True)
|
||||
assert r.exit_status == ExitStatus.ERROR_TOO_MANY_REDIRECTS
|
||||
|
||||
def test_max_redirects(httpbin):
|
||||
r = http('--max-redirects=1', '--follow', httpbin.url + '/redirect/3',
|
||||
error_exit_ok=True)
|
||||
assert r.exit_status == ExitStatus.ERROR_TOO_MANY_REDIRECTS
|
||||
|
Loading…
Reference in New Issue
Block a user