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


Python UserTracker.create_from_staged方法代码示例

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


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

示例1: test_create_with_attr

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import create_from_staged [as 别名]
    def test_create_with_attr(self, stageduser2, user, user_activated):
        """ Tests creating a user with various valid attributes listed
        in 'options_ok' list"""
        # create staged user with specified parameters
        user.ensure_exists()  # necessary for manager test
        stageduser2.ensure_missing()
        command = stageduser2.make_create_command()
        result = command()
        stageduser2.track_create()
        stageduser2.check_create(result)

        # activate user, verify that specified values were preserved
        # after activation
        user_activated.ensure_missing()
        user_activated = UserTracker(
            stageduser2.uid, stageduser2.givenname,
            stageduser2.sn, **stageduser2.kwargs)
        user_activated.create_from_staged(stageduser2)
        command = stageduser2.make_activate_command()
        result = command()
        user_activated.check_activate(result)

        # verify the staged user does not exist after activation
        command = stageduser2.make_retrieve_command()
        with raises_exact(errors.NotFound(
                reason=u'%s: stage user not found' % stageduser2.uid)):
            command()

        user_activated.delete()
开发者ID:guanwei,项目名称:freeipa,代码行数:31,代码来源:test_stageuser_plugin.py

示例2: test_activate

# 需要导入模块: from ipatests.test_xmlrpc.tracker.user_plugin import UserTracker [as 别名]
# 或者: from ipatests.test_xmlrpc.tracker.user_plugin.UserTracker import create_from_staged [as 别名]
    def test_activate(self, stageduser3, user2):
        stageduser3.ensure_exists()
        user2.ensure_missing()
        user2 = UserTracker(
            stageduser3.uid, stageduser3.givenname, stageduser3.sn)
        user2.create_from_staged(stageduser3)
        command = stageduser3.make_activate_command()
        result = command()
        user2.check_activate(result)

        command = stageduser3.make_retrieve_command()
        with raises_exact(errors.NotFound(
                reason=u'%s: stage user not found' % stageduser3.uid)):
            command()
        user2.delete()
开发者ID:guanwei,项目名称:freeipa,代码行数:17,代码来源:test_stageuser_plugin.py


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