Fix #2133 - fix call to get_client()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-10-05 15:50:16 -04:00
commit fbaea58fc1
2 changed files with 24 additions and 2 deletions

View file

@ -0,0 +1,22 @@
from __future__ import absolute_import
import pytest
from requests.exceptions import ConnectionError
from compose.cli import errors
from compose.cli.command import friendly_error_message
from tests import mock
from tests import unittest
class FriendlyErrorMessageTestCase(unittest.TestCase):
def test_dispatch_generic_connection_error(self):
with pytest.raises(errors.ConnectionErrorGeneric):
with mock.patch(
'compose.cli.command.call_silently',
autospec=True,
side_effect=[0, 1]
):
with friendly_error_message():
raise ConnectionError()