def _TestUpdateEpisode(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('update_episode', user_cookie, request_dict)
 op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
 episode_dict = deepcopy(request_dict)
 episode_dict['user_id'] = user_id
 episode_dict.pop('headers', None)
 episode_dict.pop('activity', None)
 episode = validator.ValidateUpdateDBObject(Episode, **episode_dict)
 activity_dict = {'name': 'update_episode', 'activity_id': request_dict['activity']['activity_id'], 'timestamp': request_dict['activity']['timestamp'], 'episode_id': episode.episode_id}
 invalidate = {'episodes': [{'episode_id': request_dict['episode_id'], 'get_attributes': True}]}
 validator.ValidateFollowerNotifications(episode.viewpoint_id, activity_dict, op_dict, invalidate)
 tester._CompareResponseDicts('update_episode', user_id, request_dict, {}, actual_dict)
 return actual_dict

def _TestUpdateEpisode ( 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 ( 'update_episode' , user_cookie , request_dict ) op_dict = tester . _DeriveNotificationOpDict ( user_id , device_id , request_dict ) episode_dict = deepcopy ( request_dict ) episode_dict [ 'user_id' ] = user_id episode_dict . pop ( 'headers' , None ) episode_dict . pop ( 'activity' , None ) episode = validator . ValidateUpdateDBObject ( Episode , ** episode_dict ) activity_dict = { 'name' : 'update_episode' , 'activity_id' : request_dict [ 'activity' ] [ 'activity_id' ] , 'timestamp' : request_dict [ 'activity' ] [ 'timestamp' ] , 'episode_id' : episode . episode_id } invalidate = { 'episodes' : [ { 'episode_id' : request_dict [ 'episode_id' ] , 'get_attributes' : True } ] } validator . ValidateFollowerNotifications ( episode . viewpoint_id , activity_dict , op_dict , invalidate ) tester . _CompareResponseDicts ( 'update_episode' , user_id , request_dict , { } , actual_dict ) return actual_dict
called by the servicetester in order to test update_episode service api call .