def _TestShareExisting(tester, user_cookie, request_dict):
 validator = tester.validator
 (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
 request_dict = deepcopy(request_dict)
 actual_dict = tester.SendRequest('share_existing', user_cookie, request_dict)
 op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
 validator.ValidateCopyEpisodes(op_dict, request_dict['viewpoint_id'], request_dict['episodes'])
 viewpoint_changed = validator.ValidateCoverPhoto(request_dict['viewpoint_id'])
 activity_dict = {'name': 'share_existing', 'activity_id': request_dict['activity']['activity_id'], 'timestamp': request_dict['activity']['timestamp'], 'episodes': [{'episode_id': ep_dict['new_episode_id'], 'photo_ids': ep_dict['photo_ids']} for ep_dict in request_dict['episodes']]}
 invalidate = {'episodes': [{'episode_id': ep_dict['new_episode_id'], 'get_attributes': True, 'get_photos': True} for ep_dict in request_dict['episodes']]}
 if viewpoint_changed:
  invalidate['viewpoints'] = [{'viewpoint_id': request_dict['viewpoint_id'], 'get_attributes': True}]
 validator.ValidateFollowerNotifications(request_dict['viewpoint_id'], activity_dict, op_dict, invalidate, sends_alert=True)
 validator.ValidateViewpointAccounting(request_dict['viewpoint_id'])
 tester._CompareResponseDicts('share_existing', user_id, request_dict, {}, actual_dict)
 _ValidateAutoSave(tester, user_id, device_id, request_dict)
 return actual_dict

def _TestShareExisting ( tester , user_cookie , request_dict ) : validator = tester . validator ( user_id , device_id ) = tester . GetIdsFromCookie ( user_cookie ) request_dict = deepcopy ( request_dict ) actual_dict = tester . SendRequest ( 'share_existing' , user_cookie , request_dict ) op_dict = tester . _DeriveNotificationOpDict ( user_id , device_id , request_dict ) validator . ValidateCopyEpisodes ( op_dict , request_dict [ 'viewpoint_id' ] , request_dict [ 'episodes' ] ) viewpoint_changed = validator . ValidateCoverPhoto ( request_dict [ 'viewpoint_id' ] ) activity_dict = { 'name' : 'share_existing' , 'activity_id' : request_dict [ 'activity' ] [ 'activity_id' ] , 'timestamp' : request_dict [ 'activity' ] [ 'timestamp' ] , 'episodes' : [ { 'episode_id' : ep_dict [ 'new_episode_id' ] , 'photo_ids' : ep_dict [ 'photo_ids' ] } for ep_dict in request_dict [ 'episodes' ] ] } invalidate = { 'episodes' : [ { 'episode_id' : ep_dict [ 'new_episode_id' ] , 'get_attributes' : True , 'get_photos' : True } for ep_dict in request_dict [ 'episodes' ] ] } if viewpoint_changed : invalidate [ 'viewpoints' ] = [ { 'viewpoint_id' : request_dict [ 'viewpoint_id' ] , 'get_attributes' : True } ] validator . ValidateFollowerNotifications ( request_dict [ 'viewpoint_id' ] , activity_dict , op_dict , invalidate , sends_alert = True ) validator . ValidateViewpointAccounting ( request_dict [ 'viewpoint_id' ] ) tester . _CompareResponseDicts ( 'share_existing' , user_id , request_dict , { } , actual_dict ) _ValidateAutoSave ( tester , user_id , device_id , request_dict ) return actual_dict
called by the servicetester in order to test share_existing service api call .