File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
import yaml
3
+ import kubernetes
4
+ import os
3
5
from testcontainers .k3s import K3SContainer
4
6
5
7
from ocp_resources .exceptions import ResourceTeardownError
@@ -103,3 +105,15 @@ def test_resource_context_manager_exit(self, client):
103
105
with pytest .raises (ResourceTeardownError ):
104
106
with TestSecretExit (name = "test-context-manager-exit" , namespace = "default" , client = client ):
105
107
pass
108
+
109
+ def test_proxy_conflict_raises_value_error (self ):
110
+ os .environ ["OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY" ] = "1"
111
+ os .environ ["HTTPS_PROXY" ] = "http://env-proxy.com"
112
+ client_configuration = kubernetes .client .Configuration ()
113
+ client_configuration .proxy = "http://not-env-proxy.com"
114
+ with pytest .raises (
115
+ ValueError ,
116
+ match = "Conflicting proxy settings: client_configuration.proxy=http://not-env-proxy.com, "
117
+ "but the environment variable 'OPENSHIFT_PYTHON_WRAPPER_CLIENT_USE_PROXY' defines proxy as http://env-proxy.com." ,
118
+ ):
119
+ get_client (client_configuration = client_configuration )
You can’t perform that action at this time.
0 commit comments