Merge pull request #2142 from dnephin/fix_error_cant_connect
Fix error when compose can't connect to docker
This commit is contained in:
commit
fda615008c
4 changed files with 71 additions and 45 deletions
22
tests/unit/cli/command_test.py
Normal file
22
tests/unit/cli/command_test.py
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue