• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python testgen.all_providers函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.testgen.all_providers函数的典型用法代码示例。如果您正苦于以下问题:Python all_providers函数的具体用法?Python all_providers怎么用?Python all_providers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: pytest_generate_tests

def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.all_providers(metafunc)

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        if metafunc.function in {test_vm_genealogy_detected} and args["provider"].type in {"scvmm", "rhevm"}:
            continue

        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:16,代码来源:test_genealogy.py


示例2: pytest_generate_tests

def pytest_generate_tests(metafunc):
    # Filter out providers without templates defined
    argnames, argvalues, idlist = testgen.all_providers(metafunc)
    # if metafunc.function is not test_ssa_template:
    argnames.append('analysis_type')

    new_idlist = []
    new_argvalues = []

    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        # if metafunc.function is test_ssa_template:
        #    new_idlist.append(args['provider'].key)
        #    new_argvalues.append([args["provider"]])
        #    continue

        vms = []
        provisioning_data = []

        try:
            vma_data = args['provider'].data.get('vm_analysis_new', {})
            vms = vma_data.get("vms", {})
            provisioning_data = vma_data.get("provisioning", {})
        except AttributeError:
            # Provider has no provisioning and/or vms list set
            continue

        for vm_analysis_key in vms:
            # Each VM can redefine a provisioning data
            vm_analysis_data = provisioning_data.copy()
            vm_analysis_data.update(vms[vm_analysis_key])

            if not {'image', 'fs-type'}.issubset(
                    vm_analysis_data.viewkeys()):
                continue

            if vm_analysis_data['fs-type'] not in ['ntfs', 'fat32']:
                # Username and password are required for non-windows VMs
                if not {'username', 'password'}.issubset(
                        vm_analysis_data.viewkeys()):
                    continue

            # Set VM name here
            new_idlist.append('{}-{}'.format(idlist[i], vm_analysis_key))
            new_argvalues.append([args["provider"], vm_analysis_key])
    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
开发者ID:anewmanRH,项目名称:cfme_tests,代码行数:47,代码来源:test_instance_analysis.py


示例3: pytest_generate_tests

def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.all_providers(metafunc)

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        if args["provider"].type in {"scvmm"}:
            continue

        if ((metafunc.function is test_action_create_snapshot_and_delete_last) or
            (metafunc.function is test_action_create_snapshots_and_delete_them)) \
                and args['provider'].type in {"rhevm", "openstack", "ec2"}:
            continue

        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
开发者ID:ManageIQ,项目名称:integration_tests,代码行数:21,代码来源:test_actions.py


示例4: pytest_generate_tests

def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.all_providers(metafunc,
        'small_template', scope="module", template_location=["small_template"])

    new_idlist = []
    new_argvalues = []
    for i, argvalue_tuple in enumerate(argvalues):
        args = dict(zip(argnames, argvalue_tuple))

        if args["provider_type"] in {"scvmm"}:
            continue

        if ((metafunc.function is test_action_create_snapshot_and_delete_last)
            or
            (metafunc.function is test_action_create_snapshots_and_delete_them)) \
                and isinstance(args['provider_crud'], RHEVMProvider):
            continue

        new_idlist.append(idlist[i])
        new_argvalues.append(argvalues[i])

    testgen.parametrize(metafunc, argnames, new_argvalues, ids=new_idlist, scope="module")
开发者ID:seandst,项目名称:cfme_tests,代码行数:23,代码来源:test_actions.py


示例5: pytest_generate_tests

def pytest_generate_tests(metafunc):
    # Filter out providers without provisioning data or hosts defined
    argnames, argvalues, idlist = testgen.all_providers(metafunc)
    testgen.parametrize(metafunc, argnames, argvalues, ids=idlist, scope="module")
开发者ID:richardfontana,项目名称:cfme_tests,代码行数:4,代码来源:test_discovery.py


示例6: pytest_generate_tests

def pytest_generate_tests(metafunc):
    argnames, argvalues, idlist = testgen.all_providers(metafunc, required_fields=['ownership_vm'])
    testgen.parametrize(metafunc, argnames, argvalues, ids=idlist, scope="module")
开发者ID:sakthivelramakrishnan,项目名称:cfme_tests,代码行数:3,代码来源:test_vm_ownership.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testgen.generate函数代码示例发布时间:2022-05-26
下一篇:
Python teacher.signup_teacher_directly函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap