'When an image specifies a volume, and the Compose file specifies a host path
but adds a trailing slash, make sure that we don\'t create duplicate binds.'

def test_duplicate_volume_trailing_slash(self):

    host_path = u'/tmp/data'
    container_path = u'/data'
    volumes = [VolumeSpec.parse(u'{}:{}/'.format(host_path, container_path))]
    tmp_container = self.client.create_container(u'busybox', u'true', volumes={container_path: {}}, labels={u'com.docker.compose.test_image': u'true'}, host_config={})
    image = self.client.commit(tmp_container)[u'Id']
    service = self.create_service(u'db', image=image, volumes=volumes)
    old_container = create_and_start_container(service)
    self.assertEqual(old_container.get(u'Config.Volumes'), {container_path: {}})
    service = self.create_service(u'db', image=image, volumes=volumes)
    new_container = service.recreate_container(old_container)
    self.assertEqual(new_container.get(u'Config.Volumes'), {container_path: {}})
    self.assertEqual(service.containers(stopped=False), [new_container])
