当前位置: 首页>>代码示例>>Python>>正文


Python User.quickmatch方法代码示例

本文整理汇总了Python中okcupyd.User.quickmatch方法的典型用法代码示例。如果您正苦于以下问题:Python User.quickmatch方法的具体用法?Python User.quickmatch怎么用?Python User.quickmatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okcupyd.User的用法示例。


在下文中一共展示了User.quickmatch方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_load_messages_on_message_thread

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_load_messages_on_message_thread():
    user = User()
    content = 'a message was sent'
    their_profile = user.quickmatch()
    message_info = their_profile.message(content)
    while message_info.message_id is None:
        their_profile = user.quickmatch()
        message_info = their_profile.message(content)

    assert len(user.outbox[0].messages) == 1
    assert user.outbox[0].messages[0].content == content
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:13,代码来源:messaging_test.py

示例2: test_initiator_and_respondent

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_initiator_and_respondent():
    user = User()
    their_profile = user.quickmatch()
    message_info = their_profile.message('initiated contact')
    while message_info.message_id is None:
        their_profile = user.quickmatch()
        message_info = their_profile.message('initiated contact')

    message_thread = user.outbox[0]

    assert message_thread.initiator.username == user.profile.username
    assert message_thread.respondent.username == their_profile.username
    assert message_thread.correspondent_id == their_profile.id
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:15,代码来源:messaging_test.py

示例3: test_multi_line_messages

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_multi_line_messages(vcr_live_sleep):
    user = User()
    messages = [
        """Multi-line message
first
second
third""",
        """   leading whitespace
space at the end   
   space at the beggining
"""]
    for message in messages:
        user.quickmatch().message(message)
        vcr_live_sleep(2)
        assert user.outbox()[0].messages[0].content.strip() == message.strip()
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:17,代码来源:messaging_test.py

示例4: test_user_delete_threads

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_user_delete_threads():
    user = User()
    message_info = user.message(user.quickmatch().username,
                                'abcdefghijklmnopqrstuvwxyz')
    assert message_info.thread_id != None
    user.delete_threads(user.outbox())
    assert user.outbox()[:] == []
开发者ID:ktomanek,项目名称:okcupyd,代码行数:9,代码来源:user_test.py

示例5: test_photo_delete

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_photo_delete():
    user = User()
    response_dict = user.photo.upload_and_confirm(user.quickmatch().photo_infos[0])
    before_delete_photos = user.profile.photo_infos
    user.photo.delete(response_dict['id'])
    user.profile.refresh()
    assert len(before_delete_photos) - 1 == len(user.profile.photo_infos)
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:9,代码来源:photo_test.py

示例6: test_mailbox_sync_integration

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_mailbox_sync_integration(T):
    user = User()
    T.factory.okcupyd_user(user)
    user.quickmatch().message('test... sorry.')

    Sync(user).all()

    user_model = model.User.find(user.profile.id, id_key='okc_id')
    messages = model.Message.query(
        model.Message.sender_id == user_model.id
    )

    Sync(user).all()

    assert len(messages) == len(model.Message.query(
        model.Message.sender_id == user_model.id
    ))
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:19,代码来源:mailbox_test.py

示例7: test_user_get_user_question

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_user_get_user_question():
    user = User()
    profile = user.quickmatch()
    question = profile.questions[0]
    user_question = user.get_user_question(question)
    assert question.id == user_question.id
    assert question.text == user_question.text
    assert 0 < user_question.answer_id < 5
    assert 0 < user_question.get_answer_id_for_question(question) < 5
开发者ID:ktomanek,项目名称:okcupyd,代码行数:11,代码来源:user_test.py

示例8: test_delete

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_delete(vcr_live_sleep):
    user = User()
    their_profile = user.quickmatch()
    message_info = their_profile.message('text')
    assert message_info.thread_id != None
    thread_id = user.outbox[0].id
    user.outbox[0].delete()
    vcr_live_sleep(2)
    user.outbox()
    try:
        assert user.outbox[0].id != thread_id
    except IndexError:
        pass
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:15,代码来源:messaging_test.py

示例9: test_reply

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_reply():
    user = User()
    user.quickmatch().message('test')
    message_info = user.outbox[0].reply('reply')
    assert message_info.thread_id is not None
    assert int(message_info.message_id) > 0
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:8,代码来源:messaging_test.py

示例10: rate_attractive_girls

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def rate_attractive_girls():
    user = User()
    while True:
        p = user.quickmatch()
        if user.attractiveness_finder(p.username) >= 7000:
            p.rate(5)
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:8,代码来源:site.py

示例11: test_user_message

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_user_message():
    user = User()
    message_info = user.message(user.quickmatch().username,
                                'abcdefghijklmnopqrstuvwxyz')
    assert message_info.thread_id != None
    assert int(message_info.message_id) > 0
开发者ID:ktomanek,项目名称:okcupyd,代码行数:8,代码来源:user_test.py

示例12: test_photo_info_upload

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import quickmatch [as 别名]
def test_photo_info_upload(vcr_live_sleep):
    user = User()
    response = user.photo.upload_and_confirm(user.quickmatch().photo_infos[0])
    vcr_live_sleep(2)
    assert int(response['id']) in [pi.id for pi in user.profile.photo_infos]
开发者ID:DrDMoney,项目名称:okcupyd,代码行数:7,代码来源:photo_test.py


注:本文中的okcupyd.User.quickmatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。