本文整理汇总了Python中mock.NonCallableMock.reset_mock方法的典型用法代码示例。如果您正苦于以下问题:Python NonCallableMock.reset_mock方法的具体用法?Python NonCallableMock.reset_mock怎么用?Python NonCallableMock.reset_mock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mock.NonCallableMock
的用法示例。
在下文中一共展示了NonCallableMock.reset_mock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestMeetmeServiceManager
# 需要导入模块: from mock import NonCallableMock [as 别名]
# 或者: from mock.NonCallableMock import reset_mock [as 别名]
#.........这里部分代码省略.........
self.assertEqual(self.mock_manager.leave.call_count, 0)
def test_leave(self):
start_time = 1234556.123
self.manager._cache = {conf_room_number: {'number': conf_room_number,
'name': conf_room_name,
'pin_required': True,
'start_time': start_time,
'members': {1: {'join_order': 1,
'join_time': start_time,
'number': '1002',
'name': 'Tester 1',
'channel': 'SIP/jsdhfjd-124'},
2: {'join_order': 2,
'join_time': start_time + 10,
'number': '4181235555',
'name': '4181235555',
'channel': 'DAHDI/i1/4181235555-5'}}}}
self.manager.leave(conf_room_number, 1)
expected = {conf_room_number: {'number': conf_room_number,
'name': conf_room_name,
'pin_required': True,
'start_time': start_time,
'members': {2: {'join_order': 2,
'join_time': start_time + 10,
'number': '4181235555',
'name': '4181235555',
'channel': 'DAHDI/i1/4181235555-5'}}}}
self.mock_notifier.publish_meetme_update.assert_called_once_with(expected)
self.mock_notifier.reset_mock()
self.manager.leave(conf_room_number, 2)
expected = {conf_room_number: {'number': conf_room_number,
'name': conf_room_name,
'pin_required': True,
'start_time': 0,
'members': {}}}
self.mock_notifier.publish_meetme_update.assert_called_once_with(expected)
def test_leave_after_restart(self):
start_time = 1234556.123
self.manager._cache = {
conf_room_number: {
'number': conf_room_number,
'name': conf_room_name,
'pin_required': True,
'start_time': start_time,
'members': {},
}
}
self.manager.leave(conf_room_number, 1)
self.assertEqual(self.mock_notifier.publish_meetme_update.call_count, 0)
def test_has_members(self):
self.manager._cache = {'800': {'members': {}}}
self.assertFalse(self.manager._has_members('800'))