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


Python User.create方法代码示例

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


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

示例1: test_user_change_password

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_change_password(request):
    user = User(
        name="user {}".format(fauxfactory.gen_alphanumeric()),
        credential=Credential(
            principal="user_principal_{}".format(fauxfactory.gen_alphanumeric()),
            secret="very_secret",
            verify_secret="very_secret"
        ),
        email="[email protected]",
        group=usergrp,
    )
    user.create()
    request.addfinalizer(user.delete)
    request.addfinalizer(login.login_admin)
    with user:
        assert not login.logged_in()
        login.login(user)
        assert login.current_full_name() == user.name
    login.login_admin()
    with update(user):
        user.credential = Credential(
            principal=user.credential.principal,
            secret="another_very_secret",
            verify_secret="another_very_secret",
        )
    with user:
        assert not login.logged_in()
        login.login(user)
        assert login.current_full_name() == user.name
开发者ID:rananda,项目名称:cfme_tests,代码行数:31,代码来源:test_access_control.py

示例2: test_current_user_login_delete

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [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

示例3: test_user_group_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_group_error_validation():
    user = User(
        name='user{}'.format(fauxfactory.gen_alphanumeric()),
        credential=new_credential(),
        email='[email protected]',
        group='')
    with error.expected("A User must be assigned to a Group"):
        user.create()
开发者ID:jkandasa,项目名称:integration_tests,代码行数:10,代码来源:test_access_control.py

示例4: test_user_email_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_email_error_validation():
    user = User(
        name='user' + fauxfactory.gen_alphanumeric(),
        credential=new_credential(),
        email='xyzdhat.com',
        group=group_user)
    with error.expected("Email must be a valid email address"):
        user.create()
开发者ID:rananda,项目名称:cfme_tests,代码行数:10,代码来源:test_access_control.py

示例5: test_userid_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_userid_required_error_validation():
    user = User(
        name='user' + fauxfactory.gen_alphanumeric(),
        credential=Credential(principal='', secret='redhat'),
        email='[email protected]',
        group=group_user)
    with error.expected("Userid can't be blank"):
        user.create()
开发者ID:rananda,项目名称:cfme_tests,代码行数:10,代码来源:test_access_control.py

示例6: test_username_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_username_required_error_validation():
    user = User(
        name="",
        credential=new_credential(),
        email='[email protected]',
        group=group_user)
    with error.expected("Name can't be blank"):
        user.create()
开发者ID:rananda,项目名称:cfme_tests,代码行数:10,代码来源:test_access_control.py

示例7: user

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def user():
    user = User(
        credential=Credential(principal=fauxfactory.gen_alphanumeric(), secret=fauxfactory.gen_alphanumeric()),
        name=fauxfactory.gen_alphanumeric(),
        group=Group(description="EvmGroup-super_administrator"),
    )
    user.create()
    return user
开发者ID:quarckster,项目名称:cfme_tests,代码行数:10,代码来源:test_rest.py

示例8: test_userid_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_userid_required_error_validation():
    user = User(
        name="user" + fauxfactory.gen_alphanumeric(),
        credential=Credential(principal="", secret="redhat"),
        email="[email protected]",
        group=group_user,
    )
    with error.expected("Userid can't be blank"):
        user.create()
开发者ID:ManageIQ,项目名称:integration_tests,代码行数:11,代码来源:test_access_control.py

示例9: test_user_email_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_email_error_validation(group_collection):
    group_name = 'EvmGroup-user'
    group = group_collection.instantiate(description=group_name)

    user = User(
        name='user{}'.format(fauxfactory.gen_alphanumeric()),
        credential=new_credential(),
        email='xyzdhat.com',
        group=group)
    with error.expected("Email must be a valid email address"):
        user.create()
开发者ID:jkandasa,项目名称:integration_tests,代码行数:13,代码来源:test_access_control.py

示例10: test_username_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_username_required_error_validation(group_collection):
    group_name = 'EvmGroup-user'
    group = group_collection.instantiate(description=group_name)

    user = User(
        name="",
        credential=new_credential(),
        email='[email protected]',
        group=group)
    with error.expected("Name can't be blank"):
        user.create()
开发者ID:jkandasa,项目名称:integration_tests,代码行数:13,代码来源:test_access_control.py

示例11: test_user_password_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_password_required_error_validation():
    user = User(
        name='user' + fauxfactory.gen_alphanumeric(),
        credential=Credential(principal='uid' + fauxfactory.gen_alphanumeric(), secret=None),
        email='[email protected]',
        group=group_user)
    if version.current_version() < "5.5":
        check = "Password_digest can't be blank"
    else:
        check = "Password can't be blank"
    with error.expected(check):
        user.create()
开发者ID:rananda,项目名称:cfme_tests,代码行数:14,代码来源:test_access_control.py

示例12: user_restricted

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [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

示例13: test_userid_required_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_userid_required_error_validation(group_collection):
    group_name = 'EvmGroup-user'
    group = group_collection.instantiate(description=group_name)

    user = User(
        name='user{}'.format(fauxfactory.gen_alphanumeric()),
        credential=Credential(principal='', secret='redhat'),
        email='[email protected]',
        group=group)
    with error.expected("Userid can't be blank"):
        user.create()

    # Navigating away from this page will create an "Abandon Changes" alert
    # Since group creation failed we need to reset the state of the page
    navigate_to(user.appliance.server, 'Dashboard')
开发者ID:jkandasa,项目名称:integration_tests,代码行数:17,代码来源:test_access_control.py

示例14: test_current_user_login_delete

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [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

示例15: test_user_group_error_validation

# 需要导入模块: from cfme.configure.access_control import User [as 别名]
# 或者: from cfme.configure.access_control.User import create [as 别名]
def test_user_group_error_validation():
    user = User(
        name="user" + fauxfactory.gen_alphanumeric(), credential=new_credential(), email="[email protected]", group=""
    )
    with error.expected("A User must be assigned to a Group"):
        user.create()
开发者ID:ManageIQ,项目名称:integration_tests,代码行数:8,代码来源:test_access_control.py


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