Test that --ignore-netrc doesn't interfere with --auth

This commit is contained in:
Jakub Roztocil 2019-08-31 12:14:44 +02:00
parent 1dc67a6a38
commit 3e24827f4d

View File

@ -2,6 +2,7 @@
import mock import mock
import pytest import pytest
from httpie.plugins.builtin import HTTPBasicAuth
from httpie.utils import ExplicitNullAuth from httpie.utils import ExplicitNullAuth
from utils import http, add_auth, HTTP_OK, MockEnvironment from utils import http, add_auth, HTTP_OK, MockEnvironment
import httpie.input import httpie.input
@ -98,3 +99,11 @@ def test_ignore_netrc_null_auth():
env=MockEnvironment(), env=MockEnvironment(),
) )
assert isinstance(args.auth, ExplicitNullAuth) assert isinstance(args.auth, ExplicitNullAuth)
def test_ignore_netrc_together_with_auth():
args = httpie.cli.parser.parse_args(
args=['--ignore-netrc', '--auth=username:password', 'example.org'],
env=MockEnvironment(),
)
assert isinstance(args.auth, HTTPBasicAuth)