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


Python Loader.determine_latest_version方法代碼示例

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


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

示例1: test_load_service_model

# 需要導入模塊: from botocore.loaders import Loader [as 別名]
# 或者: from botocore.loaders.Loader import determine_latest_version [as 別名]
    def test_load_service_model(self):
        class FakeLoader(object):
            def load_file(self, name):
                return ['loaded data']

        loader = Loader(extra_search_paths=['foo'],
                        file_loader=FakeLoader(),
                        include_default_search_paths=False)
        loader.determine_latest_version = mock.Mock(return_value='2015-03-01')
        loaded = loader.load_service_model('baz', type_name='service-2')
        self.assertEqual(loaded, ['loaded data'])
開發者ID:coreymaher,項目名稱:botocore,代碼行數:13,代碼來源:test_loaders.py

示例2: test_load_service_model_enforces_case

# 需要導入模塊: from botocore.loaders import Loader [as 別名]
# 或者: from botocore.loaders.Loader import determine_latest_version [as 別名]
    def test_load_service_model_enforces_case(self):
        class FakeLoader(object):
            def load_file(self, name):
                return ['loaded data']

        loader = Loader(extra_search_paths=['foo'],
                        file_loader=FakeLoader(),
                        include_default_search_paths=False)
        loader.determine_latest_version = mock.Mock(return_value='2015-03-01')
        loader.list_available_services = mock.Mock(return_value=['baz'])

        with self.assertRaises(ValidationError):
            loader.load_service_model('BAZ', type_name='service-2')
開發者ID:henrysher,項目名稱:botocorev063p,代碼行數:15,代碼來源:test_loaders.py

示例3: test_load_service_model_enforces_case

# 需要導入模塊: from botocore.loaders import Loader [as 別名]
# 或者: from botocore.loaders.Loader import determine_latest_version [as 別名]
    def test_load_service_model_enforces_case(self):
        class FakeLoader(object):
            def load_file(self, name):
                return ['loaded data']

        loader = Loader(extra_search_paths=['foo'],
                        file_loader=FakeLoader(),
                        include_default_search_paths=False)
        loader.determine_latest_version = mock.Mock(return_value='2015-03-01')
        loader.list_available_services = mock.Mock(return_value=['baz'])

        # Should have a) the unknown service name and b) list of valid
        # service names.
        with self.assertRaisesRegexp(UnknownServiceError,
                                     'Unknown service.*BAZ.*baz'):
            loader.load_service_model('BAZ', type_name='service-2')
開發者ID:brint,項目名稱:botocore,代碼行數:18,代碼來源:test_loaders.py

示例4: test_error_raised_if_service_does_not_exist

# 需要導入模塊: from botocore.loaders import Loader [as 別名]
# 或者: from botocore.loaders.Loader import determine_latest_version [as 別名]
 def test_error_raised_if_service_does_not_exist(self):
     loader = Loader(extra_search_paths=[],
                     include_default_search_paths=False)
     with self.assertRaises(DataNotFoundError):
         loader.determine_latest_version('unknownservice', 'service-2')
開發者ID:henrysher,項目名稱:botocorev063p,代碼行數:7,代碼來源:test_loaders.py


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