def __init__(self): super(MockGraphNavServicer, self).__init__() self.common_header_code = header_pb2.CommonError.CODE_OK self.nav_feedback_status = graph_nav_pb2.NavigationFeedbackResponse.STATUS_REACHED_GOAL self.nav_to_resp = graph_nav_pb2.NavigateToResponse( status=graph_nav_pb2.NavigateToResponse.STATUS_OK) self.nav_route_resp = graph_nav_pb2.NavigateRouteResponse( status=graph_nav_pb2.NavigateRouteResponse.STATUS_OK) self.upload_waypoint_resp = graph_nav_pb2.UploadWaypointSnapshotResponse( ) self.upload_edge_resp = graph_nav_pb2.UploadEdgeSnapshotResponse() self.set_loc_resp = graph_nav_pb2.SetLocalizationResponse( status=graph_nav_pb2.SetLocalizationResponse.STATUS_OK) self.lease_use_result = None
def UploadWaypointSnapshot(self, request_iterator, context): resp = graph_nav_pb2.UploadWaypointSnapshotResponse() resp.header.error.code = self.common_header_code if self.lease_use_result: resp.lease_use_result.CopyFrom(self.lease_use_result) return resp