@mock.patch('compose.service.Container', autospec=True)
def test_get_container(self, mock_container_class):
    container_dict = dict(Name='default_foo_2')
    self.mock_client.containers.return_value = [container_dict]
    service = Service('foo', image='foo', client=self.mock_client)
    container = service.get_container(number=2)
    assert (container == mock_container_class.from_ps.return_value)
    mock_container_class.from_ps.assert_called_once_with(self.mock_client, container_dict)
@mock.patch('compose.service.Container', autospec=True)
def test_get_container(self, mock_container_class):
    container_dict = dict(Name='default_foo_2')
    self.mock_client.containers.return_value = [container_dict]
    service = Service('foo', image='foo', client=self.mock_client)
    container = service.get_container(number=2)
    assert (container == mock_container_class.from_ps.return_value)
    mock_container_class.from_ps.assert_called_once_with(self.mock_client, container_dict)