本文整理汇总了Python中okcupyd.User.languages方法的典型用法代码示例。如果您正苦于以下问题:Python User.languages方法的具体用法?Python User.languages怎么用?Python User.languages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类okcupyd.User
的用法示例。
在下文中一共展示了User.languages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_nulling_of_details
# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import languages [as 别名]
def test_nulling_of_details(vcr_live_sleep):
details = User().profile.details
details.ethnicities = ['white']
vcr_live_sleep(sleep_time)
assert 'white' in [ethnicity.lower() for ethnicity in details.ethnicities]
vcr_live_sleep(sleep_time)
details.ethnicities = []
vcr_live_sleep(sleep_time)
assert details.ethnicities == []
details.bodytype = 'jacked'
vcr_live_sleep(sleep_time)
assert 'jacked' in details.bodytype.lower()
details.bodytype = None
vcr_live_sleep(sleep_time)
assert not details.bodytype
vcr_live_sleep(sleep_time)
details.languages = [('spanish', 'fluently'), ('english', 'fluently')]
vcr_live_sleep(sleep_time)
assert 'spanish' in [language[0] for language in details.languages]
# It appears that it's impossible to remove all languages.
details.languages = [('spanish', 'fluently')]
vcr_live_sleep(sleep_time)
assert details.languages == [('spanish', 'fluently')]
示例2: test_handle_no_fluency_lanaguages
# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import languages [as 别名]
def test_handle_no_fluency_lanaguages(vcr_live_sleep):
details = User().profile.details
details.languages = [('english', None)]
vcr_live_sleep(sleep_time)
assert details.languages == [('English', None)]
details.languages = [('spanish', None)]
vcr_live_sleep(sleep_time)
assert details.languages == [('Spanish', None)]
示例3: test_languages_detail
# 需要导入模块: from okcupyd import User [as 别名]
# 或者: from okcupyd.User import languages [as 别名]
def test_languages_detail(vcr_live_sleep):
details = User().profile.details
values = [
[('spanish', 'poorly'), ('english', 'fluently')],
[('catalan', 'okay')],
[('esperanto', 'fluently'), ('dutch', 'okay')],
]
for value in values:
details.languages = value
vcr_live_sleep(sleep_time)
assert details.languages == value
vcr_live_sleep(sleep_time)