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


Python rackspace_ctrl.RackspaceCtrl類代碼示例

本文整理匯總了Python中gns3.cloud.rackspace_ctrl.RackspaceCtrl的典型用法代碼示例。如果您正苦於以下問題:Python RackspaceCtrl類的具體用法?Python RackspaceCtrl怎麽用?Python RackspaceCtrl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: test_authenticate_valid_user

    def test_authenticate_valid_user(self):
        """ Test authentication with a valid user and api key. """

        ctrl = RackspaceCtrl(self.username, self.api_key, 'http://foo.bar:8888')

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, True)
        self.assertIsNotNone(ctrl.token)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:8,代碼來源:test_cloud_integration.py

示例2: test_authenticate_empty_user

    def test_authenticate_empty_user(self):
        """ Ensure authentication with empty string as username fails. """

        ctrl = RackspaceCtrl('', self.api_key)

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:madkrell,項目名稱:gns3-gui,代碼行數:8,代碼來源:test_cloud_integration.py

示例3: test_authenticate_empty_apikey

    def test_authenticate_empty_apikey(self):
        """ Ensure authentication with empty string as api_key fails. """

        ctrl = RackspaceCtrl(self.username, '', 'http://foo.bar:8888')

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:8,代碼來源:test_cloud_integration.py

示例4: test_authenticate_invalid_user

    def test_authenticate_invalid_user(self):
        """  Ensure authentication with invalid user credentials fails. """

        ctrl = RackspaceCtrl('invalid_user', 'invalid_api_key', 'http://foo.bar:8888')

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:8,代碼來源:test_cloud_integration.py

示例5: test_authenticate_invalid_user

    def test_authenticate_invalid_user(self):
        """  Ensure authentication with invalid user credentials fails. """

        ctrl = RackspaceCtrl('invalid_user', 'invalid_api_key')
        ctrl.post_fn = stub_rackspace_identity_post

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:braddeshong,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_unit.py

示例6: test_authenticate_empty_user

    def test_authenticate_empty_user(self):
        """ Ensure authentication with empty string as username fails. """

        ctrl = RackspaceCtrl('', 'valid_api_key')
        ctrl.post_fn = stub_rackspace_identity_post

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:braddeshong,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_unit.py

示例7: test_authenticate_empty_apikey

    def test_authenticate_empty_apikey(self):
        """ Ensure authentication with empty string as api_key fails. """

        ctrl = RackspaceCtrl('valid_user', '', 'http://foo.bar:8888')
        ctrl.post_fn = stub_rackspace_identity_post

        auth_result = ctrl.authenticate()
        self.assertEqual(auth_result, False)
        self.assertIsNone(ctrl.token)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_unit.py

示例8: test_token_parsed

    def test_token_parsed(self):
        """ Ensure that the token is set. """

        ctrl = RackspaceCtrl('valid_user', 'valid_api_key', 'http://foo.bar:8888')
        ctrl.post_fn = stub_rackspace_identity_post

        ctrl.authenticate()

        self.assertEqual('abcdefgh0123456789', ctrl.token)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_unit.py

示例9: test_set_invalid_region

    def test_set_invalid_region(self):
        """ Ensure that calling 'set_region' with an invalid param fails. """

        ctrl = RackspaceCtrl(self.username, self.api_key, 'http://foo.bar:8888')
        ctrl.authenticate()

        result = self.ctrl.set_region('invalid')

        self.assertEqual(result, False)
        self.assertIsNone(ctrl.region)
        self.assertIsNone(ctrl.driver)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:11,代碼來源:test_cloud_integration.py

示例10: test_set_region

    def test_set_region(self):
        """ Ensure that set_region sets 'region' and 'driver'. """

        ctrl = RackspaceCtrl(self.username, self.api_key, 'http://foo.bar:8888')
        ctrl.authenticate()

        result = ctrl.set_region('iad')

        self.assertEqual(result, True)
        self.assertEqual(ctrl.region, 'iad')
        self.assertIsNotNone(ctrl.driver)
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:11,代碼來源:test_cloud_integration.py

示例11: setUp

 def setUp(self):
     # prefix to identify created objects
     self.object_prefix = "int_test_"
     self.prefix_length = len(self.object_prefix)
     self.ctrl = RackspaceCtrl(self.username, self.api_key, 'http://foo.bar:8888')
     self.ctrl.authenticate()
     self.ctrl.set_region('ord')
     self.gns3_image = None
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:8,代碼來源:test_cloud_integration.py

示例12: setUp

 def setUp(self):
     self.username = username
     self.api_key = api_key
     # prefix to identify created objects
     self.object_prefix = "int_test_"
     self.prefix_length = len(self.object_prefix)
     self.ctrl = RackspaceCtrl(self.username, self.api_key)
     self.ctrl.authenticate()
     self.ctrl.set_region('ord')
開發者ID:madkrell,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_integration.py

示例13: setUp

    def setUp(self):
        """ Set up the objects used by most of the tests. """

        self.ctrl = RackspaceCtrl('valid_user', 'valid_api_key')
        self.ctrl.post_fn = stub_rackspace_identity_post
        self.ctrl.driver_cls = MockLibCloudDriver
        self.ctrl.authenticate()
        self.ctrl.set_region('iad')
        self.key_pair = TestRackspaceCtrlDriver.StubObject(public_key='keystr')
開發者ID:braddeshong,項目名稱:gns3-gui,代碼行數:9,代碼來源:test_cloud_unit.py

示例14: setUp

    def setUp(self):
        # prefix to identify created objects
        self.object_prefix = "int_test_"
        self.prefix_length = len(self.object_prefix)
        self.ctrl = RackspaceCtrl(self.username, self.api_key, "http://foo.bar:8888")
        self.ctrl.authenticate()
        self.ctrl.set_region("ord")
        self.gns3_image = None

        self.ctrl.GNS3_CONTAINER_NAME = "TEST_GNS3"
開發者ID:planctechnologies,項目名稱:gns3-gui,代碼行數:10,代碼來源:test_cloud_integration.py

示例15: setUp

    def setUp(self):
        """ Set up the objects used by most of the tests. """

        self.ctrl = RackspaceCtrl('valid_user', 'valid_api_key', 'http://foo.bar:8888')
        self.ctrl.post_fn = stub_rackspace_identity_post
        self.ctrl.driver_cls = MockLibCloudDriver
        self.ctrl.authenticate()
        self.ctrl.set_region('iad')
        self.ctrl.get_image = mock.MagicMock()
        self.ctrl.get_image.return_value = ''
        self.key_pair = TestRackspaceCtrlDriver.StubObject(public_key='keystr')
開發者ID:avdoshkin,項目名稱:gns3-gui,代碼行數:11,代碼來源:test_cloud_unit.py


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