Use docker SDK 2.0
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
635a281777
commit
04e5925a23
11 changed files with 20 additions and 20 deletions
|
|
@ -15,7 +15,7 @@ from compose.config.config import Config
|
|||
def mock_service():
|
||||
return mock.create_autospec(
|
||||
service.Service,
|
||||
client=mock.create_autospec(docker.Client),
|
||||
client=mock.create_autospec(docker.APIClient),
|
||||
options={})
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class CLITestCase(unittest.TestCase):
|
|||
@mock.patch('compose.cli.main.RunOperation', autospec=True)
|
||||
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
||||
def test_run_interactive_passes_logs_false(self, mock_pseudo_terminal, mock_run_operation):
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
project = Project.from_config(
|
||||
name='composetest',
|
||||
client=mock_client,
|
||||
|
|
@ -128,7 +128,7 @@ class CLITestCase(unittest.TestCase):
|
|||
assert call_kwargs['logs'] is False
|
||||
|
||||
def test_run_service_with_restart_always(self):
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
|
||||
project = Project.from_config(
|
||||
name='composetest',
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class ContainerTest(unittest.TestCase):
|
|||
self.assertEqual(container.name_without_project, "custom_name_of_container")
|
||||
|
||||
def test_inspect_if_not_inspected(self):
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
container = Container(mock_client, dict(Id="the_id"))
|
||||
|
||||
container.inspect_if_not_inspected()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from compose.service import Service
|
|||
|
||||
class ProjectTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.mock_client = mock.create_autospec(docker.Client)
|
||||
self.mock_client = mock.create_autospec(docker.APIClient)
|
||||
|
||||
def test_from_config(self):
|
||||
config = Config(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from compose.service import warn_on_masked_volume
|
|||
class ServiceTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.mock_client = mock.create_autospec(docker.Client)
|
||||
self.mock_client = mock.create_autospec(docker.APIClient)
|
||||
|
||||
def test_containers(self):
|
||||
service = Service('db', self.mock_client, 'myproject', image='foo')
|
||||
|
|
@ -666,7 +666,7 @@ class ServiceTest(unittest.TestCase):
|
|||
class TestServiceNetwork(object):
|
||||
|
||||
def test_connect_container_to_networks_short_aliase_exists(self):
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
service = Service(
|
||||
'db',
|
||||
mock_client,
|
||||
|
|
@ -751,7 +751,7 @@ class NetTestCase(unittest.TestCase):
|
|||
def test_network_mode_service(self):
|
||||
container_id = 'bbbb'
|
||||
service_name = 'web'
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
mock_client.containers.return_value = [
|
||||
{'Id': container_id, 'Name': container_id, 'Image': 'abcd'},
|
||||
]
|
||||
|
|
@ -765,7 +765,7 @@ class NetTestCase(unittest.TestCase):
|
|||
|
||||
def test_network_mode_service_no_containers(self):
|
||||
service_name = 'web'
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_client = mock.create_autospec(docker.APIClient)
|
||||
mock_client.containers.return_value = []
|
||||
|
||||
service = Service(name=service_name, client=mock_client)
|
||||
|
|
@ -783,7 +783,7 @@ def build_mount(destination, source, mode='rw'):
|
|||
class ServiceVolumesTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.mock_client = mock.create_autospec(docker.Client)
|
||||
self.mock_client = mock.create_autospec(docker.APIClient)
|
||||
|
||||
def test_build_volume_binding(self):
|
||||
binding = build_volume_binding(VolumeSpec.parse('/outside:/inside', True))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from tests import mock
|
|||
|
||||
@pytest.fixture
|
||||
def mock_client():
|
||||
return mock.create_autospec(docker.Client)
|
||||
return mock.create_autospec(docker.APIClient)
|
||||
|
||||
|
||||
class TestVolume(object):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue