예제 #1
0
 def add_follow(self, foreign, local, state=None):
     self.add_follow_called_with = (foreign, local, state)
     resp = database_pb2.DbFollowResponse()
     ids = set(self.users_dict.values())
     if foreign not in ids or local not in ids:
         resp.result_type = general_pb2.ResultType.ERROR
         return resp
     resp.result_type = general_pb2.ResultType.OK
     return resp
예제 #2
0
 def Follow(self, follow_req):
     '''Stands in for database_stub.Follow'''
     self.follow_called_with = follow_req
     resp = database_pb2.DbFollowResponse()
     resp.result_type = general_pb2.ResultType.OK
     return resp
예제 #3
0
 def Follow(self, request, context):
     response = database_pb2.DbFollowResponse()
     self._follow_type_handlers[request.request_type](request, response)
     return response