def change_encrypted_space_key(self, space_uuid, new_key_repr=None):
"""Edit the existing space with UUID ``space_uuid`` and set its GPG key
to the existing one matching ``new_key_repr``, if provided, or else to
any other key.
"""
self.navigate(self.get_space_edit_url(space_uuid))
select = Select(self.driver.find_element_by_id('id_protocol-key'))
if new_key_repr:
select.select_by_visible_text(new_key_repr)
else:
currently_selected = select.first_selected_option.text
for option in select.options:
if option.text != currently_selected:
select.select_by_visible_text(option.text)
break
self.driver.find_element_by_css_selector('input[type=submit]').click()
self.wait_for_presence('div.alert-success')
archivematicaselenium.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录