本文整理汇总了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()
示例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()
示例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()
示例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()