本文整理汇总了Python中asynctest.mock.Mock.end方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.end方法的具体用法?Python Mock.end怎么用?Python Mock.end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asynctest.mock.Mock
的用法示例。
在下文中一共展示了Mock.end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_talks
# 需要导入模块: from asynctest.mock import Mock [as 别名]
# 或者: from asynctest.mock.Mock import end [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