當前位置: 首頁>>代碼示例>>Python>>正文


Python User.delete方法代碼示例

本文整理匯總了Python中cfme.configure.access_control.User.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python User.delete方法的具體用法?Python User.delete怎麽用?Python User.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cfme.configure.access_control.User的用法示例。


在下文中一共展示了User.delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_current_user_login_delete

# 需要導入模塊: from cfme.configure.access_control import User [as 別名]
# 或者: from cfme.configure.access_control.User import delete [as 別名]
def test_current_user_login_delete(request):
    """Test for deleting current user login.

    Steps:
        * Login as Admin user
        * Create a new user
        * Login with the new user
        * Try deleting the user
    """
    group_user = Group("EvmGroup-super_administrator")
    user = User(
        name='user' + fauxfactory.gen_alphanumeric(),
        credential=new_credential(),
        email='[email protected]',
        group=group_user)
    user.create()
    request.addfinalizer(user.delete)
    request.addfinalizer(login.login_admin)
    with user:
        if version.current_version() >= '5.7':
            navigate_to(user, 'Details')
            menu_item = ('Configuration', 'Delete this User')
            assert tb.exists(*menu_item) and tb.is_greyed(*menu_item), "Delete User is not dimmed"
        else:
            with error.expected("Current EVM User \"{}\" cannot be deleted".format(user.name)):
                user.delete()
開發者ID:rananda,項目名稱:cfme_tests,代碼行數:28,代碼來源:test_access_control.py

示例2: test_delete_default_user

# 需要導入模塊: from cfme.configure.access_control import User [as 別名]
# 或者: from cfme.configure.access_control.User import delete [as 別名]
def test_delete_default_user():
    """Test for deleting default user Administrator.

    Steps:
        * Login as Administrator user
        * Try deleting the user
    """
    user = User(name='Administrator')
    with pytest.raises(RBACOperationBlocked):
        user.delete()
開發者ID:jkandasa,項目名稱:integration_tests,代碼行數:12,代碼來源:test_access_control.py

示例3: user_restricted

# 需要導入模塊: from cfme.configure.access_control import User [as 別名]
# 或者: from cfme.configure.access_control.User import delete [as 別名]
def user_restricted(group_with_tag, new_credential):
    """
        Returns restricted user object assigned
        to group with tag filter used in test module
    """
    user = User(
        name='user{}'.format(fauxfactory.gen_alphanumeric()),
        credential=new_credential,
        email='[email protected]',
        group=group_with_tag,
        cost_center='Workload',
        value_assign='Database')
    user.create()
    yield user
    user.delete()
開發者ID:dajohnso,項目名稱:cfme_tests,代碼行數:17,代碼來源:tag.py

示例4: test_current_user_login_delete

# 需要導入模塊: from cfme.configure.access_control import User [as 別名]
# 或者: from cfme.configure.access_control.User import delete [as 別名]
def test_current_user_login_delete(request):
    """Test for deleting current user login.

    Steps:
        * Login as Admin user
        * Create a new user
        * Login with the new user
        * Try deleting the user
    """
    group_user = Group("EvmGroup-super_administrator")
    user = User(
        name='user' + fauxfactory.gen_alphanumeric(),
        credential=new_credential(),
        email='[email protected]',
        group=group_user)
    user.create()
    request.addfinalizer(user.delete)
    request.addfinalizer(login.login_admin)
    with user:
        with error.expected("Current EVM User \"{}\" cannot be deleted".format(user.name)):
            user.delete()
開發者ID:RonnyPfannschmidt,項目名稱:cfme_tests,代碼行數:23,代碼來源:test_access_control.py


注:本文中的cfme.configure.access_control.User.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。