def conversations_session(token): """ Create a Conversations API for testing, uses the token for auth """ channel = fake_channel(token) conversations_pb2_grpc.add_ConversationsServicer_to_server(Conversations(), channel) yield conversations_pb2_grpc.ConversationsStub(channel)
def conversations_session(db, token): """ Create a Conversations API for testing, uses the token for auth """ user_id, jailed = Auth(db).get_session_for_token(token) channel = FakeChannel(user_id=user_id) conversations_pb2_grpc.add_ConversationsServicer_to_server( Conversations(db), channel) yield conversations_pb2_grpc.ConversationsStub(channel)