本文整理匯總了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')