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


Python GroupService.create方法代码示例

本文整理汇总了Python中h.services.group.GroupService.create方法的典型用法代码示例。如果您正苦于以下问题:Python GroupService.create方法的具体用法?Python GroupService.create怎么用?Python GroupService.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在h.services.group.GroupService的用法示例。


在下文中一共展示了GroupService.create方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_create_sets_group_ids

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_sets_group_ids(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert group.id
        assert group.pubid
开发者ID:gnott,项目名称:h,代码行数:9,代码来源:group_test.py

示例2: test_create_publishes_join_event

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_publishes_join_event(self, db_session, users):
        publish = mock.Mock(spec_set=[])
        svc = GroupService(db_session, users.get, publish=publish)

        group = svc.create('Dishwasher disassemblers', 'foobar.com', 'theresa')

        publish.assert_called_once_with('group-join', group.pubid, 'theresa')
开发者ID:gnott,项目名称:h,代码行数:9,代码来源:group_test.py

示例3: test_create_sets_access_flags_for_group_types

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_sets_access_flags_for_group_types(self,
                                                      db_session,
                                                      users,
                                                      group_type,
                                                      flag,
                                                      expected_value):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir', type_=group_type)

        assert getattr(group, flag) == expected_value
开发者ID:gnott,项目名称:h,代码行数:13,代码来源:group_test.py

示例4: test_create_adds_group_to_session

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_adds_group_to_session(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert group in db_session
开发者ID:gnott,项目名称:h,代码行数:8,代码来源:group_test.py

示例5: test_create_raises_for_invalid_group_type

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_raises_for_invalid_group_type(self, db_session, users):
        svc = GroupService(db_session, users.get)

        with pytest.raises(ValueError):
            svc.create('Anteater fans', 'foobar.com', 'cazimir', type_='foo')
开发者ID:gnott,项目名称:h,代码行数:7,代码来源:group_test.py

示例6: test_create_skips_setting_description_when_missing

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_skips_setting_description_when_missing(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert group.description is None
开发者ID:gnott,项目名称:h,代码行数:8,代码来源:group_test.py

示例7: test_create_sets_description_when_present

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_sets_description_when_present(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir', 'all about ant eaters')

        assert group.description == 'all about ant eaters'
开发者ID:gnott,项目名称:h,代码行数:8,代码来源:group_test.py

示例8: test_create_sets_group_authority

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_sets_group_authority(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert group.authority == 'foobar.com'
开发者ID:gnott,项目名称:h,代码行数:8,代码来源:group_test.py

示例9: test_create_returns_group

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_returns_group(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert isinstance(group, Group)
开发者ID:gnott,项目名称:h,代码行数:8,代码来源:group_test.py

示例10: test_create_doesnt_add_group_creator_to_members_for_publisher_groups

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_doesnt_add_group_creator_to_members_for_publisher_groups(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir', type_='publisher')

        assert users['cazimir'] not in group.members
开发者ID:soapdog,项目名称:h,代码行数:8,代码来源:group_test.py

示例11: test_create_adds_group_creator_to_members

# 需要导入模块: from h.services.group import GroupService [as 别名]
# 或者: from h.services.group.GroupService import create [as 别名]
    def test_create_adds_group_creator_to_members(self, db_session, users):
        svc = GroupService(db_session, users.get)

        group = svc.create('Anteater fans', 'foobar.com', 'cazimir')

        assert users['cazimir'] in group.members
开发者ID:soapdog,项目名称:h,代码行数:8,代码来源:group_test.py


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