當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。