本文整理汇总了Python中curdling.index.Index.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Index.delete方法的具体用法?Python Index.delete怎么用?Python Index.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curdling.index.Index
的用法示例。
在下文中一共展示了Index.delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_retrieve_and_build
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_retrieve_and_build():
"Install#retrieve_and_build() "
# Given that I have an installer with a working index
index = Index(FIXTURE('tmp'))
installer = Install(**{
'conf': {
'index': index,
'pypi_urls': ['http://localhost:8000/simple']
},
})
installer.pipeline()
# And I feed the installer with a requirement
installer.feed('tests', requirement='gherkin')
# And start the installer
installer.start()
# When I run the retrieve and build loop
packages = installer.retrieve_and_build()
# Than I see that the package was retrieved
packages.should.equal(set(['gherkin']))
# And I clean the mess
index.delete()
示例2: test_downloader
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_downloader():
"It should be possible to download packages from pip repos"
# Given the following downloader component
sources = [PipSource(urls=['http://localhost:8000/simple'])]
index = Index(FIXTURE('tmpindex'))
downloader = DownloadManager(sources=sources, index=index)
# When I try to retrieve a package from it
package = downloader.retrieve('gherkin==0.1.0', 'main')
# Then I see that the package was downloaded correctly to the storage
index.get('gherkin==0.1.0').should_not.be.empty
# And I cleanup the mess
index.delete()
示例3: test_index_from_data
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_index_from_data():
"It should be possible to index data from memory"
# Given the following index
index = Index(FIXTURE('index'))
# When I index a file
data = open(FIXTURE('storage1/gherkin-0.1.0.tar.gz'), 'rb').read()
index.from_data(path='gherkin-0.1.0.tar.gz', data=data)
# Then I see it inside of the index
index.get('gherkin==0.1.0').should.equal(
FIXTURE('index/gherkin-0.1.0.tar.gz'),
)
# And I clean the mess
index.delete()
示例4: test_index_from_file
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_index_from_file():
"It should be possible to index packages from files"
# Given the following index
index = Index(FIXTURE('index'))
# When I index a file
index.from_file(FIXTURE('storage1/gherkin-0.1.0.tar.gz'))
# Then I see it inside of the index
index.get('gherkin==0.1.0;gz').should.equal(
FIXTURE('index/gherkin-0.1.0.tar.gz'),
)
# And that there's no wheel available yet
index.get.when.called_with('gherkin==0.1.0;whl').should.throw(
PackageNotFound,
)
# And I clean the mess
index.delete()
示例5: test_downloader
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_downloader():
"It should be possible to download packages from pip repos"
# Given that I have a finder pointing to our local pypi server
finder = Finder(**{"conf": {"pypi_urls": ["http://localhost:8000/simple"]}})
# And a downloader pointing to a temporary index
index = Index(FIXTURE("tmpindex"))
downloader = Downloader(**{"index": index})
# When I find the link
link = finder.handle("tests", {"requirement": "gherkin (== 0.1.0)"})
# And When I try to retrieve a package from it
downloader.handle("main", link)
# Then I see that the package was downloaded correctly to the storage
index.get("gherkin==0.1.0").should_not.be.empty
# And I cleanup the mess
index.delete()
示例6: test_retrieve_and_build
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_retrieve_and_build():
"Install#retrieve_and_build() "
# Given that I have an installer with a working index
index = Index(FIXTURE("tmp"))
installer = Install(**{"conf": {"index": index, "pypi_urls": ["http://localhost:8000/simple"]}})
installer.pipeline()
# And I handle the installer with a requirement
installer.queue("tests", requirement="gherkin")
# And start the installer
installer.start()
# When I run the retrieve and build loop
packages = installer.retrieve_and_build()
# Than I see that the package was retrieved
packages.should.equal(set(["gherkin"]))
# And I clean the mess
index.delete()
示例7: test_downloader
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import delete [as 别名]
def test_downloader():
"It should be possible to download packages from pip repos"
# Given that I have a finder pointing to our local pypi server
finder = Finder(**{
'conf': {'pypi_urls': ['http://localhost:8000/simple']},
})
# And a downloader pointing to a temporary index
index = Index(FIXTURE('tmpindex'))
downloader = Downloader(**{'index': index})
# When I find the link
link = finder.handle('tests', {'requirement': 'gherkin (== 0.1.0)'})
# And When I try to retrieve a package from it
downloader.handle('main', link)
# Then I see that the package was downloaded correctly to the storage
index.get('gherkin==0.1.0').should_not.be.empty
# And I cleanup the mess
index.delete()