Skip to content

Commit

Permalink
tests: session: Remake test_insecure_host into test_trusted_host
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Gorny committed Mar 26, 2020
1 parent 544c307 commit 2050ecc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_network_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_http_cache_is_not_enabled(self, tmpdir):

assert not hasattr(session.adapters["http://"], "cache")

def test_insecure_host_adapter(self, tmpdir):
def test_trusted_hosts_adapter(self, tmpdir):
session = PipSession(
cache=tmpdir.joinpath("test-cache"),
trusted_hosts=["example.com"],
Expand All @@ -81,8 +81,8 @@ def test_insecure_host_adapter(self, tmpdir):
assert "https://example.com/" in session.adapters
# Check that the "port wildcard" is present.
assert "https://example.com:" in session.adapters
# Check that the cache isn't enabled.
assert not hasattr(session.adapters["https://example.com/"], "cache")
# Check that the cache is enabled.
assert hasattr(session.adapters["https://example.com/"], "cache")

def test_add_trusted_host(self):
# Leave a gap to test how the ordering is affected.
Expand Down

0 comments on commit 2050ecc

Please sign in to comment.