mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Fix #2133 - fix call to get_client()
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
aefb7a44b2
commit
fbaea58fc1
@ -38,10 +38,10 @@ def friendly_error_message():
|
||||
raise errors.DockerNotFoundUbuntu()
|
||||
else:
|
||||
raise errors.DockerNotFoundGeneric()
|
||||
elif call_silently(['which', 'boot2docker']) == 0:
|
||||
elif call_silently(['which', 'docker-machine']) == 0:
|
||||
raise errors.ConnectionErrorDockerMachine()
|
||||
else:
|
||||
raise errors.ConnectionErrorGeneric(self.get_client().base_url)
|
||||
raise errors.ConnectionErrorGeneric(get_client().base_url)
|
||||
|
||||
|
||||
def project_from_options(base_dir, options):
|
||||
|
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…
x
Reference in New Issue
Block a user