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


Python User.search方法代码示例

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


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

示例1: test_question_filter_with_custom_answers

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import search [as 别名]
def test_question_filter_with_custom_answers():
    user = User()
    user_question = user.questions.somewhat_important[1]
    unacceptable_answers = [answer_option.id
                            for answer_option in user_question.answer_options
                            if not answer_option.is_match]
    for profile in user.search(question=user_question.id,
                               question_answers=unacceptable_answers)[:5]:
        question = profile.find_question(user_question.id)
        assert not question.their_answer_matches
开发者ID:gitter-badger,项目名称:okcupyd,代码行数:12,代码来源:search_test.py

示例2: test_search_populates_upfront

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import search [as 别名]
def test_search_populates_upfront():
    user = User()
    search_fetchable = user.search()
    for profile in search_fetchable[:4]:
        profile_session = profile._session
        with mock.patch.object(profile, '_session') as mock_session:
            mock_session.okc_get.side_effect = profile_session.okc_get
            assert profile.id > 0
            assert mock_session.okc_get.call_count == 0
            profile.essays.self_summary
            assert mock_session.okc_get.call_count == 1
开发者ID:gitter-badger,项目名称:okcupyd,代码行数:13,代码来源:search_test.py

示例3: test_question_count_filter

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import search [as 别名]
def test_question_count_filter():
    user = User()
    for profile in user.search(question_count_min=250)[:5]:
        assert profile.questions[249]
开发者ID:gitter-badger,项目名称:okcupyd,代码行数:6,代码来源:search_test.py

示例4: test_question_filter

# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import search [as 别名]
def test_question_filter():
    user = User()
    user_question = user.questions.somewhat_important[0]
    for profile in user.search(question=user_question)[:5]:
        question = profile.find_question(user_question.id)
        assert question.their_answer_matches
开发者ID:gitter-badger,项目名称:okcupyd,代码行数:8,代码来源:search_test.py


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