本文整理汇总了Python中enstaller.repository.Repository.from_repository_infos方法的典型用法代码示例。如果您正苦于以下问题:Python Repository.from_repository_infos方法的具体用法?Python Repository.from_repository_infos怎么用?Python Repository.from_repository_infos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enstaller.repository.Repository
的用法示例。
在下文中一共展示了Repository.from_repository_infos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_from_repository_infos_empty
# 需要导入模块: from enstaller.repository import Repository [as 别名]
# 或者: from enstaller.repository.Repository import from_repository_infos [as 别名]
def test_from_repository_infos_empty(self):
# Given
repository_info = BroodRepositoryInfo("https://api.enthought.com",
"enthought/free")
config = Configuration(use_webservice=False,
auth=("nono", "password"))
config._store_kind = STORE_KIND_BROOD
session = Session.authenticated_from_configuration(config)
# When
repository = Repository.from_repository_infos(
session, (repository_info,)
)
# Then
self.assertEqual(len(repository), 0)
示例2: test_from_repository_infos_nonempty
# 需要导入模块: from enstaller.repository import Repository [as 别名]
# 或者: from enstaller.repository.Repository import from_repository_infos [as 别名]
def test_from_repository_infos_nonempty(self):
# Given
repository_infos = (
BroodRepositoryInfo("https://api.enthought.com", "enthought/free"),
BroodRepositoryInfo(
"https://api.enthought.com", "enthought/commercial"
),
)
config = Configuration(use_webservice=False,
auth=("nono", "password"))
config._store_kind = STORE_KIND_BROOD
session = Session.authenticated_from_configuration(config)
# When
repository = Repository.from_repository_infos(session, repository_infos)
# Then
self.assertEqual(len(repository), 2)
self.assertEqual(len(repository.find_packages("nose")), 2)