'Test update existing image members'

def test_update_all_image_existing_deleted_members(self):

    UUID8 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID8, size=19, protected=False, owner='test    user')
    db_api.image_create(self.context, extra_fixture)
    req = webob.Request.blank(('/images/%s/members/test1' % UUID8))
    req.method = 'PUT'
    req.get_response(self.api)
    self.get_api_response_ext(http.NO_CONTENT, method='DELETE', url=('/images/%s/members/test1' % UUID8))
    fixture = [dict(member_id='test1', can_share=False)]
    body = jsonutils.dump_as_bytes(dict(memberships=fixture))
    self.get_api_response_ext(http.NO_CONTENT, url=('/images/%s/members' % UUID8), method='PUT', body=body, content_type='json')
    memb_list = db_api.image_member_find(self.context, image_id=UUID8)
    self.assertEqual(1, len(memb_list))
