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


Python Version.lowest方法代码示例

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


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

示例1: create

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
    def create(self, cancel=False):
        """Create new keypair"""
        def refresh():
            self.provider.refresh_provider_relationships()
            view.browser.selenium.refresh()
            view.flush_widget_cache()

        view = navigate_to(self, 'Add')
        view.form.fill({'name': self.name,
                        'public_key': self.public_key,
                        'provider': self.provider.name})
        if cancel:
            view.form.cancel.click()
            flash_message = 'Add of new Key Pair was cancelled by the user'
        else:
            view.form.add.click()
            flash_message = VersionPick({
                Version.lowest(): 'Creating Key Pair {}'.format(self.name),
                '5.8': 'Key Pair "{}" created'.format(self.name)}).pick(self.appliance.version)

        # add/cancel should redirect, new view
        view = self.create_view(KeyPairAllView)
        # TODO BZ 1444520 causing ridiculous redirection times after submitting the form
        wait_for(lambda: view.is_displayed, fail_condition=False, num_sec=120, delay=3,
                 fail_func=lambda: view.flush_widget_cache(), handle_exception=True)
        view = self.create_view(KeyPairAllView)
        view.entities.flash.assert_no_error()
        view.entities.flash.assert_success_message(flash_message)
开发者ID:dajohnso,项目名称:cfme_tests,代码行数:30,代码来源:keypairs.py

示例2: pytest_generate_tests

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def pytest_generate_tests(metafunc):
    """
    Build a list of tuples containing (group_name, context)
    Returns:
        tuple containing (group_name, context)
        where group_name is a string and context is ViaUI/SSUI
    """
    appliance = find_appliance(metafunc)
    parameter_list = []
    id_list = []
    # TODO: Include SSUI role_access dict and VIASSUI context
    role_access_ui = VersionPick({
        Version.lowest(): role_access_ui_58z,
        '5.9': role_access_ui_59z,
        '5.10': role_access_ui_510z
    }).pick(appliance.version)
    logger.info('Using the role access dict: %s', role_access_ui)
    roles_and_context = [(
        role_access_ui, ViaUI)
    ]
    for role_access, context in roles_and_context:
        for group in role_access.keys():
            parameter_list.append((group, role_access, context))
            id_list.append('{}-{}'.format(group, context))
    metafunc.parametrize('group_name, role_access, context', parameter_list)
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:27,代码来源:test_aws_iam_auth_and_roles.py

示例3: all

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
    def all(self):
        # containers table has ems_id, join with ext_mgmgt_systems on id for provider name
        # Then join with container_groups on the id for the pod
        # TODO Update to use REST API instead of DB queries
        container_table = self.appliance.db.client['containers']
        ems_table = self.appliance.db.client['ext_management_systems']
        pod_table = self.appliance.db.client['container_groups']
        container_pod_id = (
            VersionPick({
                Version.lowest(): getattr(container_table, 'container_definition_id', None),
                '5.9': getattr(container_table, 'container_group_id', None)})
            .pick(self.appliance.version))
        container_query = (
            self.appliance.db.client.session
                .query(container_table.name, pod_table.name, ems_table.name)
                .join(ems_table, container_table.ems_id == ems_table.id)
                .join(pod_table, container_pod_id == pod_table.id))
        if self.filters.get('archived'):
            container_query = container_query.filter(container_table.deleted_on.isnot(None))
        if self.filters.get('active'):
            container_query = container_query.filter(container_table.deleted_on.is_(None))
        provider = None
        # filtered
        if self.filters.get('provider'):
            provider = self.filters.get('provider')
            container_query = container_query.filter(ems_table.name == provider.name)
        containers = []
        for name, pod_name, ems_name in container_query.all():
            containers.append(
                self.instantiate(name=name, pod=pod_name,
                                 provider=provider or get_crud_by_name(ems_name)))

        return containers
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:35,代码来源:container.py

示例4: ProviderEntity

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def ProviderEntity():  # noqa
    """ Temporary wrapper for Provider Entity during transition to JS based Entity

    """
    return VersionPick({
        Version.lowest(): NonJSProviderEntity,
        '5.9': JSProviderEntity,
    })
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:10,代码来源:provider_views.py

示例5: parent_provider

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def parent_provider(self):
     """ Return object of parent cloud provider """
     view = navigate_to(self, 'Details')
     parent_cloud_text = VersionPick({Version.lowest(): 'Parent ems cloud',
                                      '5.10': 'Parent Cloud Provider'}
                                     ).pick(self.appliance.version)
     provider_name = view.entities.relationships.get_text_of(parent_cloud_text)
     return providers.get_crud_by_name(provider_name)
开发者ID:apagac,项目名称:cfme_tests,代码行数:10,代码来源:cloud_network.py

示例6: is_displayed

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def is_displayed(self):
     title = VersionPicker({
         Version.lowest(): '{name} (All VM Templates)'.format(name=self.context['object'].name),
         '5.10': '{name} (All VM Templates and Images)'.format(name=self.context['object'].name),
     }).pick(self.extra.appliance.version)
     return (self.logged_in_as_current_user and
             self.navigation.currently_selected == ['Compute', 'Infrastructure', 'Providers'] and
             self.title.text == title)
开发者ID:apagac,项目名称:cfme_tests,代码行数:10,代码来源:provider_views.py

示例7: HostEntity

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def HostEntity():  # noqa
    """ Temporary wrapper for Host Entity during transition to JS based Entity

    """
    return VersionPick({
        Version.lowest(): NonJSHostEntity,
        '5.9': JSBaseEntity,
    })
开发者ID:dajohnso,项目名称:cfme_tests,代码行数:10,代码来源:host_views.py

示例8: before_filling

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def before_filling(self):
     item_type = self.context['object'].provider_type or \
         self.context['object'].item_type or 'Generic'
     if item_type == 'AnsibleTower':
         item_type = VersionPick({
             Version.lowest(): "AnsibleTower",
             "5.9": "Ansible Tower"
         })
     self.select_item_type.select_by_visible_text(item_type)
     self.flush_widget_cache()
开发者ID:akarol,项目名称:cfme_tests,代码行数:12,代码来源:catalog_item.py

示例9: delete

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
    def delete(self, cancel=False, wait=False):
        view = navigate_to(self, 'Details')
        # TODO: get rid of this resolve when widgetastic.core/pull/68 is merged
        item_name = VersionPick({Version.lowest(): 'Remove this Key Pair',
                                '5.9': 'Remove this Key Pair from Inventory'}
                                ).pick(self.appliance.version)
        view.toolbar.configuration.item_select(item_name,
                                               handle_alert=(not cancel))
        # cancel doesn't redirect, confirmation does
        view.flush_widget_cache()
        if cancel:
            view = self.create_view(KeyPairDetailsView)
        else:
            view = self.create_view(KeyPairAllView)
        wait_for(lambda: view.is_displayed, fail_condition=False, num_sec=10, delay=1)

        # flash message only displayed if it was deleted
        if not cancel:
            view.flash.assert_no_error()
            view.flash.assert_success_message('Delete initiated for 1 Key Pair')

        if wait:
            def refresh():
                self.provider.refresh_provider_relationships()
                view.browser.refresh()
                view.flush_widget_cache()

            view = navigate_to(self.parent, 'All')

            wait_for(
                lambda: self.name in view.entities.all_entity_names,
                message="Wait keypairs to disappear",
                fail_condition=True,
                num_sec=300,
                delay=5,
                fail_func=refresh
            )
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:39,代码来源:keypairs.py

示例10: view_classes

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def view_classes(self):
     return VersionPick({
         Version.lowest(): RetirementView,
         "5.9": RetirementViewWithOffset
     })
开发者ID:LandoCalrizzian,项目名称:cfme_tests,代码行数:7,代码来源:__init__.py

示例11: ManageIQTree

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def ManageIQTree(tree_id=None):  # noqa
    return VersionPick({
        Version.lowest(): DynaTree(tree_id),
        '5.7.0.1': BootstrapTreeview(tree_id),
    })
开发者ID:RonnyPfannschmidt,项目名称:cfme_tests,代码行数:7,代码来源:widgetastic_manageiq.py

示例12: container_provider_edit_view_class

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def container_provider_edit_view_class(self):
     return VersionPick({
         Version.lowest(): ContainerProviderEditView,
         '5.9': ContainerProviderEditViewUpdated
     })
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:7,代码来源:__init__.py

示例13: step

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
 def step(self):
     self.prerequisite_view.toolbar.configuration.item_select(
         VersionPick({
             Version.lowest(): 'Add Existing Containers Provider',
             '5.9': 'Add a new Containers Provider'
         }).pick(self.obj.appliance.version))
开发者ID:hhovsepy,项目名称:cfme_tests,代码行数:8,代码来源:__init__.py

示例14: DeploymentRoleEntity

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def DeploymentRoleEntity():  # noqa
    """Temporary wrapper for Deployment Role Entity during transition to JS based Entity """
    return VersionPick({
        Version.lowest(): NonJSDepRoleEntity,
        '5.9': JSBaseEntity,
    })
开发者ID:lcouzens,项目名称:cfme_tests,代码行数:8,代码来源:deployment_roles.py

示例15: DatastoreEntity

# 需要导入模块: from widgetastic.utils import Version [as 别名]
# 或者: from widgetastic.utils.Version import lowest [as 别名]
def DatastoreEntity():  # noqa
    """Temporary wrapper for Datastore Entity during transition to JS based Entity """
    return VersionPick({
        Version.lowest(): NonJSDatastoreEntity,
        '5.9': JSDatastoreEntity,
    })
开发者ID:akarol,项目名称:cfme_tests,代码行数:8,代码来源:datastore.py


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