本文整理汇总了Python中subscription_manager.repolib.YumReleaseverSource.get_expansion方法的典型用法代码示例。如果您正苦于以下问题:Python YumReleaseverSource.get_expansion方法的具体用法?Python YumReleaseverSource.get_expansion怎么用?Python YumReleaseverSource.get_expansion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription_manager.repolib.YumReleaseverSource
的用法示例。
在下文中一共展示了YumReleaseverSource.get_expansion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mem_cache_works
# 需要导入模块: from subscription_manager.repolib import YumReleaseverSource [as 别名]
# 或者: from subscription_manager.repolib.YumReleaseverSource import get_expansion [as 别名]
def test_mem_cache_works(self):
inj.provide(inj.RELEASE_STATUS_CACHE, Mock())
release_mock = inj.require(inj.RELEASE_STATUS_CACHE)
release = "MockServer"
mock_release = {'releaseVer': release}
release_mock.read_status = Mock(return_value=mock_release)
release_source = YumReleaseverSource()
exp = release_source.get_expansion()
self.assertEqual(exp, release)
self.assertEqual(release_source._expansion, release)
exp = release_source.get_expansion()
self.assertEqual(exp, release)
示例2: test_mem_cache_pre_cached
# 需要导入模块: from subscription_manager.repolib import YumReleaseverSource [as 别名]
# 或者: from subscription_manager.repolib.YumReleaseverSource import get_expansion [as 别名]
def test_mem_cache_pre_cached(self):
inj.provide(inj.RELEASE_STATUS_CACHE, Mock())
release_mock = inj.require(inj.RELEASE_STATUS_CACHE)
release = "MockServer"
mock_release = {"releaseVer": release}
release_mock.read_status = Mock(return_value=mock_release)
release_source = YumReleaseverSource()
cached_release = "CachedMockServer"
release_source._expansion = cached_release
exp = release_source.get_expansion()
self.assertEquals(exp, cached_release)
self.assertEquals(release_source._expansion, cached_release)
示例3: test_read_status_not_set
# 需要导入模块: from subscription_manager.repolib import YumReleaseverSource [as 别名]
# 或者: from subscription_manager.repolib.YumReleaseverSource import get_expansion [as 别名]
def test_read_status_not_set(self):
inj.provide(inj.RELEASE_STATUS_CACHE, Mock())
release_mock = inj.require(inj.RELEASE_STATUS_CACHE)
release = ""
mock_release = {'releaseVer': release}
release_mock.read_status = Mock(return_value=mock_release)
release_source = YumReleaseverSource()
exp = release_source.get_expansion()
# we were unset, should return the default
self.assertEqual(exp, YumReleaseverSource.default)
# and cache it
self.assertEqual(release_source._expansion, YumReleaseverSource.default)
示例4: test_default
# 需要导入模块: from subscription_manager.repolib import YumReleaseverSource [as 别名]
# 或者: from subscription_manager.repolib.YumReleaseverSource import get_expansion [as 别名]
def test_default(self):
release_source = YumReleaseverSource()
exp = release_source.get_expansion()
self.assertEqual(exp, "$releasever")