Merge pull request #1963 from shin-/1923-catch-timeout

Exit gracefully when requests encounter a ReadTimeout exception.
This commit is contained in:
Aanand Prasad 2015-09-04 16:14:32 -07:00
commit 10cb0c921a
5 changed files with 27 additions and 5 deletions

View file

@ -16,7 +16,7 @@ class DockerClientTestCase(unittest.TestCase):
docker_client.docker_client()
def test_docker_client_with_custom_timeout(self):
with mock.patch.dict(os.environ):
os.environ['DOCKER_CLIENT_TIMEOUT'] = timeout = "300"
timeout = 300
with mock.patch('compose.cli.docker_client.HTTP_TIMEOUT', 300):
client = docker_client.docker_client()
self.assertEqual(client.timeout, int(timeout))
self.assertEqual(client.timeout, int(timeout))