1
0
mirror of https://github.com/httpie/cli.git synced 2025-06-15 00:15:06 +02:00

add -A as short arg for --auth-type

Addresses #430
comes with unit test
This commit is contained in:
Michael Floering
2016-01-22 18:37:30 -06:00
parent 4f755a8bde
commit ac69d4311b
2 changed files with 4 additions and 3 deletions

View File

@ -14,11 +14,12 @@ class TestAuth:
assert HTTP_OK in r
assert r.json == {'authenticated': True, 'user': 'user'}
@pytest.mark.parametrize('argument_name', ['--auth-type', '-A'])
@pytest.mark.skipif(
requests.__version__ == '0.13.6',
reason='Redirects with prefetch=False are broken in Requests 0.13.6')
def test_digest_auth(self, httpbin):
r = http('--auth-type=digest', '--auth=user:password',
def test_digest_auth(self, httpbin, argument_name):
r = http('{}=digest'.format(argument_name), '--auth=user:password',
'GET', httpbin.url + '/digest-auth/auth/user/password')
assert HTTP_OK in r
assert r.json == {'authenticated': True, 'user': 'user'}