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