summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoffrey F <f.joffrey@gmail.com>2017-06-14 15:18:10 -0700
committerGitHub <noreply@github.com>2017-06-14 15:18:10 -0700
commit1eef700eb7726ac9f1649e4bbdb1034d8243730d (patch)
tree205c6114568c810fe136f37189d76d8ad64b07ef /tests
parentbe0a15a89c2c4d28aebed17cca304312480691c7 (diff)
parentff993dd858ffb3c6367013ed2c468903f0cf4fe9 (diff)
downloaddocker-py-1eef700eb7726ac9f1649e4bbdb1034d8243730d.tar.gz
Merge pull request #1634 from grahamlyons/readtimeout_calling_container_stop
Ensure default timeout is used by API Client
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/client_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py
index b79c68e..c4996f1 100644
--- a/tests/unit/client_test.py
+++ b/tests/unit/client_test.py
@@ -1,6 +1,9 @@
import datetime
import docker
from docker.utils import kwargs_from_env
+from docker.constants import (
+ DEFAULT_DOCKER_API_VERSION, DEFAULT_TIMEOUT_SECONDS
+)
import os
import unittest
@@ -96,3 +99,13 @@ class FromEnvTest(unittest.TestCase):
client = docker.from_env(version='2.32')
self.assertEqual(client.api.base_url, "https://192.168.59.103:2376")
self.assertEqual(client.api._version, '2.32')
+
+ def test_from_env_without_version_uses_default(self):
+ client = docker.from_env()
+
+ self.assertEqual(client.api._version, DEFAULT_DOCKER_API_VERSION)
+
+ def test_from_env_without_timeout_uses_default(self):
+ client = docker.from_env()
+
+ self.assertEqual(client.api.timeout, DEFAULT_TIMEOUT_SECONDS)