本文整理汇总了Python中curdling.index.Index.scan方法的典型用法代码示例。如果您正苦于以下问题:Python Index.scan方法的具体用法?Python Index.scan怎么用?Python Index.scan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curdling.index.Index
的用法示例。
在下文中一共展示了Index.scan方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_curd_package
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_curd_package():
"It should possible to convert regular packages to wheels"
# Given that I have a storage containing a package
index = Index(FIXTURE('storage1'))
index.scan()
# And a curdling using that index
curdling = Curdling(index=index)
# When I request a curd to be created
package = curdling.wheel('gherkin==0.1.0', ('main', {
'path': index.get('gherkin==0.1.0;~whl')}))
# Then I see it's a wheel package.
package.should.equal({
'path': FIXTURE('storage1/gherkin-0.1.0-py27-none-any.whl'),
})
# And that it's present in the index
package = index.get('gherkin==0.1.0;whl')
# And that the file was created in the file system
os.path.exists(package).should.be.true
# And I delete the file
os.unlink(package)
示例2: test_curd_package
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_curd_package():
"It should possible to convert regular packages to wheels"
# Given that I have a storage containing a package
index = Index(FIXTURE('storage1'))
index.scan()
# And a curdling using that index
curdling = Curdler(**{'index': index})
# When I request a curd to be created
package = curdling.handle('main', {
'tarball': index.get('gherkin==0.1.0;~whl'),
'requirement': 'gherkin (0.1.0)',
})
# Then I see it's a wheel package.
package['wheel'].should.match(
FIXTURE('storage1/gherkin-0.1.0-py\d{2}-none-any.whl'))
# And that it's present in the index
package = index.get('gherkin==0.1.0;whl')
# And that the file was created in the file system
os.path.exists(package).should.be.true
# And I delete the file
os.unlink(package)
示例3: test_index_scan_when_there_is_no_dir
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_index_scan_when_there_is_no_dir():
"Index.scan() should not fail when the dir does not exist"
# Given that I have an index that points to a directory that already
# contains packages
index = Index('I know this directory does not exist')
# When I scan the directory, I see it does not fail
index.scan()
示例4: test_index_scan
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_index_scan():
"It should be possible to scan for already existing folders"
# Given that I have an index that points to a folder that already contains
# packages
index = Index(FIXTURE('storage1'))
# When I scan the directory
index.scan()
# Then I can look for packages
index.get('gherkin==0.1.0').should.equal(
FIXTURE('storage1/gherkin-0.1.0.tar.gz'),
)
示例5: test_install_package
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_install_package():
"It should possible to install wheels"
# Given that I have an installer configured with a loaded index
index = Index(FIXTURE("storage2"))
index.scan()
installer = Installer(**{"index": index})
# When I request a curd to be created
installer.handle("main", {"requirement": "gherkin==0.1.0", "wheel": index.get("gherkin==0.1.0;whl")})
# Then I see that the package was installed
Database.check_installed("gherkin==0.1.0").should.be.true
# And I uninstall the package
Database.uninstall("gherkin==0.1.0")
示例6: test_install_package
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_install_package():
"It should possible to install wheels"
# Given that I have an installer configured with a loaded index
index = Index(FIXTURE('storage2'))
index.scan()
installer = Installer(index=index)
# When I request a curd to be created
installer.install('gherkin==0.1.0', ('main', {
'path': index.get('gherkin==0.1.0;whl')}))
# Then I see that the package was installed
Env({}).check_installed('gherkin==0.1.0').should.be.true
# And I uninstall the package
Env({}).uninstall('gherkin==0.1.0')
示例7: test_install_package
# 需要导入模块: from curdling.index import Index [as 别名]
# 或者: from curdling.index.Index import scan [as 别名]
def test_install_package():
"It should possible to install wheels"
# Given that I have an installer configured with a loaded index
index = Index(FIXTURE('storage2'))
index.scan()
installer = Installer(**{'index': index})
# When I request a curd to be created
installer.handle('main', {
'requirement': 'gherkin==0.1.0',
'wheel': index.get('gherkin==0.1.0;whl'),
})
# Then I see that the package was installed
Database.check_installed('gherkin==0.1.0').should.be.true
# And I uninstall the package
Database.uninstall('gherkin==0.1.0')