当前位置: 首页>>代码示例>>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;未经允许,请勿转载。