def test_get_volumes_from_service_container_exists(self):
    container_ids = ['aabbccddee', '12345']
    from_service = mock.create_autospec(Service)
    from_service.containers.return_value = [mock.Mock(id=container_id, spec=Container) for container_id in container_ids]
    service = Service('test', volumes_from=[VolumeFromSpec(from_service, 'rw', 'service')], image='foo')
    assert (service._get_volumes_from() == [(container_ids[0] + ':rw')])
def test_get_volumes_from_service_container_exists(self):
    container_ids = ['aabbccddee', '12345']
    from_service = mock.create_autospec(Service)
    from_service.containers.return_value = [mock.Mock(id=container_id, spec=Container) for container_id in container_ids]
    service = Service('test', volumes_from=[VolumeFromSpec(from_service, 'rw', 'service')], image='foo')
    assert (service._get_volumes_from() == [(container_ids[0] + ':rw')])