本文整理匯總了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)
示例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)
示例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
示例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,
})
示例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)
示例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)
示例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,
})
示例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()
示例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
)
示例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
})
示例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),
})
示例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
})
示例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))
示例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,
})
示例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,
})