当前位置: 首页>>代码示例>>Python>>正文


Python Index.scan方法代码示例

本文整理汇总了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)
开发者ID:pombredanne,项目名称:curdling,代码行数:29,代码来源:test_main.py

示例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)
开发者ID:harobed,项目名称:curdling,代码行数:30,代码来源:test_main.py

示例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()
开发者ID:pombredanne,项目名称:curdling,代码行数:11,代码来源:test_index.py

示例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'),
    )
开发者ID:pombredanne,项目名称:curdling,代码行数:16,代码来源:test_index.py

示例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")
开发者ID:qrees,项目名称:curdling,代码行数:18,代码来源:test_main.py

示例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')
开发者ID:pombredanne,项目名称:curdling,代码行数:19,代码来源:test_main.py

示例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')
开发者ID:harobed,项目名称:curdling,代码行数:21,代码来源:test_main.py


注:本文中的curdling.index.Index.scan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。