mirror of https://github.com/docker/docs.git
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()
|
raise errors.DockerNotFoundUbuntu()
|
||||||
else:
|
else:
|
||||||
raise errors.DockerNotFoundGeneric()
|
raise errors.DockerNotFoundGeneric()
|
||||||
elif call_silently(['which', 'boot2docker']) == 0:
|
elif call_silently(['which', 'docker-machine']) == 0:
|
||||||
raise errors.ConnectionErrorDockerMachine()
|
raise errors.ConnectionErrorDockerMachine()
|
||||||
else:
|
else:
|
||||||
raise errors.ConnectionErrorGeneric(self.get_client().base_url)
|
raise errors.ConnectionErrorGeneric(get_client().base_url)
|
||||||
|
|
||||||
|
|
||||||
def project_from_options(base_dir, options):
|
def project_from_options(base_dir, options):
|
||||||
|
|
|
@ -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…
Reference in New Issue