當前位置: 首頁>>代碼示例>>Python>>正文


Python GuiOps.create_bucket_from_dashboard方法代碼示例

本文整理匯總了Python中guiops.guiops.GuiOps.create_bucket_from_dashboard方法的典型用法代碼示例。如果您正苦於以下問題:Python GuiOps.create_bucket_from_dashboard方法的具體用法?Python GuiOps.create_bucket_from_dashboard怎麽用?Python GuiOps.create_bucket_from_dashboard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在guiops.guiops.GuiOps的用法示例。


在下文中一共展示了GuiOps.create_bucket_from_dashboard方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Buckets_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import create_bucket_from_dashboard [as 別名]
class Buckets_operations_sequence(GuiOps):

    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']

        self.tester = GuiOps(
            console_url=self.console_url,
            webdriver_url=self.webdriver_url,
            sauce=self.sauce,
            browser=self.browser,
            version=self.version,
            platform=self.platform)
        logging.basicConfig(format='%(asctime)s %(message)s')

    def get_bucket_name(self):
        return self.id_generator() + '-bucket'

    def bucket_ops_test(self):
        self.tester.login(self.account, self.user, self.password)

        self._create_from_dashboard()
        self._create_from_landing_page()
        self._upload_object_detail_page()
        self._upload_object_contents_page()
        self._delete_all_objects_from_contents_page()

        self.tester.logout()
        self.tester.exit_browser()

    def _create_from_dashboard(self):
        bucket_name = self.get_bucket_name()
        self.tester.create_bucket_from_dashboard(bucket_name)
        self.tester.delete_bucket_from_view_page(bucket_name)

    def _create_from_landing_page(self):
        bucket_name = self.get_bucket_name()
        self.tester.create_bucket_from_landing_page(bucket_name)
        self.tester.delete_bucket_from_detail_page(bucket_name)

    def _upload_object_detail_page(self):
        bucket_name = self.get_bucket_name()
        self.tester.create_bucket_from_landing_page(bucket_name)
        object_name = self.tester.upload_object_from_details_page(bucket_name)
        self.tester.delete_object_from_contents_page(bucket_name, object_name)
        self.tester.delete_bucket_from_detail_page(bucket_name)

    def _upload_object_contents_page(self):
        bucket_name = self.get_bucket_name()
        self.tester.create_bucket_from_landing_page(bucket_name)
        object_name = self.tester.upload_object_from_contents_page(bucket_name)
        self.tester.delete_object_from_contents_page(bucket_name, object_name)
        self.tester.delete_bucket_from_detail_page(bucket_name)

    def _delete_all_objects_from_contents_page(self):
        bucket_name = self.get_bucket_name()
        self.tester.create_bucket_from_landing_page(bucket_name)
        for _ in xrange(3):
            self.tester.upload_object_from_contents_page(bucket_name)
        self.tester.delete_all_objects_from_contents_page(bucket_name)
        self.tester.delete_bucket_from_detail_page(bucket_name)
開發者ID:aliceh,項目名稱:eucaconsole,代碼行數:71,代碼來源:buckets.py


注:本文中的guiops.guiops.GuiOps.create_bucket_from_dashboard方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。