コード例 #1
0
ファイル: test_fixtures.py プロジェクト: KentIIX/couchers
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)
コード例 #2
0
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)