summaryrefslogtreecommitdiff
path: root/tests/unit/cli/docker_client_test.py
diff options
context:
space:
mode:
authorAanand Prasad <aanand.prasad@gmail.com>2016-07-29 17:12:40 +0100
committerAanand Prasad <aanand.prasad@gmail.com>2016-07-29 17:12:46 +0100
commit5aeeecb6f2044860f09be0bada7f4d75f489cb47 (patch)
tree09e7eab942119212efc3520c38f72a315b97854c /tests/unit/cli/docker_client_test.py
parentdec2c83014813b94cda47f2fd3938f489cee9605 (diff)
Fix stacktrace when handling timeout error
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Diffstat (limited to 'tests/unit/cli/docker_client_test.py')
-rw-r--r--tests/unit/cli/docker_client_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/cli/docker_client_test.py b/tests/unit/cli/docker_client_test.py
index fc914791..3430c25c 100644
--- a/tests/unit/cli/docker_client_test.py
+++ b/tests/unit/cli/docker_client_test.py
@@ -42,6 +42,14 @@ class DockerClientTestCase(unittest.TestCase):
assert fake_log.error.call_count == 1
assert '123' in fake_log.error.call_args[0][0]
+ with mock.patch('compose.cli.errors.log') as fake_log:
+ with pytest.raises(errors.ConnectionError):
+ with errors.handle_connection_errors(client):
+ raise errors.ReadTimeout()
+
+ assert fake_log.error.call_count == 1
+ assert '123' in fake_log.error.call_args[0][0]
+
def test_user_agent(self):
client = docker_client(os.environ)
expected = "docker-compose/{0} docker-py/{1} {2}/{3}".format(