当前位置: 首页>>代码示例>>Python>>正文


Python GroupService.member_leave方法代码示例

本文整理汇总了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
开发者ID:gnott,项目名称:h,代码行数:12,代码来源:group_test.py

示例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')
开发者ID:gnott,项目名称:h,代码行数:14,代码来源:group_test.py


注:本文中的h.services.group.GroupService.member_leave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。