Skip to content

Commit

Permalink
Test proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Jun 15, 2022
1 parent 19f7535 commit 49f3865
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/functional/test_proxy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ssl
from pathlib import Path
from typing import Any, Dict, Optional
from typing import Any, Dict

import proxy
import pytest
Expand All @@ -17,16 +17,16 @@


class AccessLogPlugin(HttpProxyBasePlugin):
def on_access_log(self, context: Dict[str, Any]) -> Optional[Dict[str, Any]]:
def on_access_log(self, context: Dict[str, Any]) -> None:
print(context)
return super().on_access_log(context)


@pytest.mark.network
def test_proxy_overrides_env(script: PipTestEnvironment) -> None:
with proxy.Proxy(
port=8899,
), proxy.Proxy(plugins=[AccessLogPlugin], port=8888):
num_acceptors=1,
), proxy.Proxy(plugins=[AccessLogPlugin], port=8888, num_acceptors=1):
script.environ["http_proxy"] = "127:0.0.1:8888"
script.environ["https_proxy"] = "127:0.0.1:8888"
result = script.pip(
Expand Down

0 comments on commit 49f3865

Please sign in to comment.