本文整理匯總了Python中okcupyd.User.copy方法的典型用法代碼示例。如果您正苦於以下問題:Python User.copy方法的具體用法?Python User.copy怎麽用?Python User.copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類okcupyd.User
的用法示例。
在下文中一共展示了User.copy方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_profile_questions_copy
# 需要導入模塊: from okcupyd import User [as 別名]
# 或者: from okcupyd.User import copy [as 別名]
def test_profile_questions_copy(vcr_live_sleep):
# This could be better...
with mock.patch('okcupyd.profile_copy.time.sleep', vcr_live_sleep):
user = User()
# Find a user that has answered fewer than 50 questions.
# This is going to issue an insane number of requests if we don't do this
profile = get_profile_with_max_questions(
user, max_questions=50
)
user.copy(profile).questions()
for question in profile.questions():
assert question.their_answer == question.my_answer
示例2: test_profile_copy_smoke_test
# 需要導入模塊: from okcupyd import User [as 別名]
# 或者: from okcupyd.User import copy [as 別名]
def test_profile_copy_smoke_test(vcr_live_sleep):
with mock.patch('okcupyd.profile_copy.time.sleep', vcr_live_sleep):
user = User()
profile = get_profile_with_max_questions(user, 50)
user.copy(profile).all()