本文整理汇总了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'])
示例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')
示例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')
示例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')