summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2019-01-09 14:38:53 -0800
committerJoffrey F <joffrey@docker.com>2019-01-09 14:45:13 -0800
commita579e9e20578ca9a074b28865ff594ed02fba6b3 (patch)
tree24165632ebfe3ca707e4675b0039d31ae3830aed /tests
parent1073b7364846709ad005e7991045d38365d911c9 (diff)
downloaddocker-py-proxy_env_fixes.tar.gz
Remove use_config_proxy from exec. Add use_config_proxy docs to DockerClientproxy_env_fixes
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/models_containers_test.py13
-rw-r--r--tests/unit/models_containers_test.py4
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/integration/models_containers_test.py b/tests/integration/models_containers_test.py
index b48f6fb..92eca36 100644
--- a/tests/integration/models_containers_test.py
+++ b/tests/integration/models_containers_test.py
@@ -163,6 +163,19 @@ class ContainerCollectionTest(BaseIntegrationTest):
assert logs[0] == b'hello\n'
assert logs[1] == b'world\n'
+ def test_run_with_proxy_config(self):
+ client = docker.from_env(version=TEST_API_VERSION)
+ client.api._proxy_configs = docker.utils.proxy.ProxyConfig(
+ ftp='sakuya.jp:4967'
+ )
+
+ out = client.containers.run(
+ 'alpine', 'sh -c "env"', use_config_proxy=True
+ )
+
+ assert b'FTP_PROXY=sakuya.jp:4967\n' in out
+ assert b'ftp_proxy=sakuya.jp:4967\n' in out
+
def test_get(self):
client = docker.from_env(version=TEST_API_VERSION)
container = client.containers.run("alpine", "sleep 300", detach=True)
diff --git a/tests/unit/models_containers_test.py b/tests/unit/models_containers_test.py
index b35aeb6..f44e365 100644
--- a/tests/unit/models_containers_test.py
+++ b/tests/unit/models_containers_test.py
@@ -416,7 +416,7 @@ class ContainerTest(unittest.TestCase):
client.api.exec_create.assert_called_with(
FAKE_CONTAINER_ID, "echo hello world", stdout=True, stderr=True,
stdin=False, tty=False, privileged=True, user='', environment=None,
- workdir=None, use_config_proxy=False,
+ workdir=None,
)
client.api.exec_start.assert_called_with(
FAKE_EXEC_ID, detach=False, tty=False, stream=True, socket=False,
@@ -430,7 +430,7 @@ class ContainerTest(unittest.TestCase):
client.api.exec_create.assert_called_with(
FAKE_CONTAINER_ID, "docker ps", stdout=True, stderr=True,
stdin=False, tty=False, privileged=True, user='', environment=None,
- workdir=None, use_config_proxy=False,
+ workdir=None,
)
client.api.exec_start.assert_called_with(
FAKE_EXEC_ID, detach=False, tty=False, stream=False, socket=False,