Skip to content

Commit 798ef9e

Browse files
committed
Add test for proxy enabled without proxy env variables set
1 parent b617c53 commit 798ef9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_resources.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ def test_resource_context_manager_exit(self, client):
105105
with TestSecretExit(name="test-context-manager-exit", namespace="default", client=client):
106106
pass
107107

108+
def test_proxy_enabled_but_no_proxy_set(self, monkeypatch):
109+
monkeypatch.setenv(name="OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY", value="1")
110+
111+
with pytest.raises(
112+
ValueError,
113+
match="Proxy configuration is enabled but neither HTTPS_PROXY nor HTTP_PROXY environment variables are set.",
114+
):
115+
get_client()
116+
108117
def test_proxy_conflict_raises_value_error(self, monkeypatch):
109118
monkeypatch.setenv(name="OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY", value="1")
110119
monkeypatch.setenv(name="HTTPS_PROXY", value="http://env-proxy.com")

0 commit comments

Comments
 (0)