本文整理匯總了Python中okcupyd.User.get_user_question方法的典型用法代碼示例。如果您正苦於以下問題:Python User.get_user_question方法的具體用法?Python User.get_user_question怎麽用?Python User.get_user_question使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類okcupyd.User
的用法示例。
在下文中一共展示了User.get_user_question方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_log_path_for_user_question_not_found
# 需要導入模塊: from okcupyd import User [as 別名]
# 或者: from okcupyd.User import get_user_question [as 別名]
def test_log_path_for_user_question_not_found(mock_time):
mock_time.time.return_value = 2
user = User(mock.Mock())
with mock.patch('okcupyd.profile.Profile.find_question',
return_value=None):
user.get_user_question(mock.Mock())
assert mock_time.sleep.call_count
示例2: test_user_get_user_question
# 需要導入模塊: from okcupyd import User [as 別名]
# 或者: from okcupyd.User import get_user_question [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