本文整理汇总了Python中asynctest.mock.Mock.partner1_sent方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.partner1_sent方法的具体用法?Python Mock.partner1_sent怎么用?Python Mock.partner1_sent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asynctest.mock.Mock
的用法示例。
在下文中一共展示了Mock.partner1_sent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_talks
# 需要导入模块: from asynctest.mock import Mock [as 别名]
# 或者: from asynctest.mock.Mock import partner1_sent [as 别名]
def get_talks(talks_json):
talks = []
for talk_json in talks_json:
talk = Mock()
talk.partner1_sent = talk_json['partner1_sent']
talk.partner2_sent = talk_json['partner2_sent']
talk.searched_since = datetime.datetime.fromtimestamp(talk_json['searched_since'])
talk.begin = datetime.datetime.fromtimestamp(talk_json['begin'])
if talk_json['end'] is not None:
talk.end = datetime.datetime.fromtimestamp(talk_json['end'])
talks.append(talk)
return talks