本文整理汇总了Python中h.services.group.GroupService.member_leave方法的典型用法代码示例。如果您正苦于以下问题:Python GroupService.member_leave方法的具体用法?Python GroupService.member_leave怎么用?Python GroupService.member_leave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类h.services.group.GroupService
的用法示例。
在下文中一共展示了GroupService.member_leave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_member_leave_removes_user_from_group
# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import member_leave [as 别名]
def test_member_leave_removes_user_from_group(self, db_session, users):
svc = GroupService(db_session, users.get)
group = Group(name='Theresa and her buddies',
authority='foobar.com',
creator=users['theresa'])
group.members.append(users['cazimir'])
svc.member_leave(group, 'cazimir')
assert users['cazimir'] not in group.members
示例2: test_member_leave_publishes_leave_event
# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import member_leave [as 别名]
def test_member_leave_publishes_leave_event(self, db_session, users):
publish = mock.Mock(spec_set=[])
svc = GroupService(db_session, users.get, publish=publish)
group = Group(name='Donkey Trust',
authority='foobari.com',
creator=users['theresa'])
group.members.append(users['cazimir'])
group.pubid = 'abc123'
svc.member_leave(group, 'cazimir')
publish.assert_called_once_with('group-leave', 'abc123', 'cazimir')